English 中文(简体)
Bootstrap Tutorial

Bootstrap with CSS

Bootstrap Layout Components

Bootstrap Plugins

Bootstrap Demos

Bootstrap Useful Resources

Selected Reading

Bootstrap - Tables
  • 时间:2025-02-21

Bootstrap - Tables


Previous Page Next Page  

Bootstrap provides a clean layout for building tables. Some of the table elements supported by Bootstrap are −

Sr.No. Tag & Description
1

<table>

Wrapping element for displaying data in a tabular format

2

<thead>

Container element for table header rows (<tr>) to label table columns.

3

<tbody>

Container element for table rows (<tr>) in the body of the table.

4

<tr>

Container element for a set of table cells (<td> or <th>) that appears on a single row.

5

<td>

Default table cell.

6

<th>

Special table cell for column (or row, depending on scope and placement) labels. Must be used within a <thead>

7

<caption>

Description or summary of what the table holds.

Basic Table

If you want a nice, basic table style with just some pght padding and horizontal spaniders, add the base class of .table to any table as shown in the following example −

<table class = "table">
   <caption>Basic Table Layout</caption>
   
   <thead>
      <tr>
         <th>Name</th>
         <th>City</th>
      </tr>
   </thead>
   
   <tbody>
      <tr>
         <td>Tanmay</td>
         <td>Bangalore</td>
      </tr>
      
      <tr>
         <td>Sachin</td>
         <td>Mumbai</td>
      </tr>
   </tbody>
</table>