Table markup

Tag Description
<table> Wrapping element for displaying data in a tabular format
<thead> Container element for table header rows (<tr>) to label table columns
<tbody> Container element for table rows (<tr>) in the body of the table
<tr> Container element for a set of table cells (<td> or <th>) that appears on a single row
<td> Default table cell
<th> Special table cell for column (or row, depending on scope and placement) labels
Must be used within a <thead>
<caption> Description or summary of what the table holds, especially useful for screen readers
 森宝利娱乐城 www.4wvq.cn <table>
  <thead>
    <tr>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td></td>
      <td></td>
    </tr>
  </tbody>
</table>

Table options

Name Class Description
Default None No styles, just columns and rows
Basic .table Only horizontal lines between rows
Bordered .table-bordered Rounds corners and adds outer border
Zebra-stripe .table-striped Adds light gray background color to odd rows (1, 3, 5, etc)
Condensed .table-condensed Cuts vertical padding in half, from 8px to 4px, within all td and th elements

Example tables

1. Default table styles

Tables are automatically styled with only a few borders to ensure readability and maintain structure. With 2.0, the .table class is required.

<table class="table">
  
</table>
# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

2. Striped table

Get a little fancy with your tables by adding zebra-striping—just add the .table-striped class.

Note: Striped tables use the :nth-child CSS selector and is not available in IE7-IE8.

<table class="table table-striped">
  
</table>
# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

3. Bordered table

Add borders around the entire table and rounded corners for aesthetic purposes.

<table class="table table-bordered">
  
</table>
# First Name Last Name Username
1 Mark Otto @mdo
Mark Otto @TwBootstrap
2 Jacob Thornton @fat
3 Larry the Bird @twitter

4. Condensed table

Make your tables more compact by adding the .table-condensed class to cut table cell padding in half (from 8px to 4px).

<table class="table table-condensed">
  
</table>
# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

5. Combine them all!

Feel free to combine any of the table classes to achieve different looks by utilizing any of the available classes.

<table class="table table-striped table-bordered table-condensed">
  ...
</table>
Full name
# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter
  • 干惊天动地事  做崇德守廉人 2019-03-21
  • 强国博客管理员.blog的博客—强国博客—人民网 2019-03-17
  • 增城区荔城街举办融合社区建设成果展 2019-02-26
  • 中巴经济走廊卡西姆港燃煤电站首台机组投产发电 2019-02-26
  • 打倒控房抄者有理,去分房好! 2019-02-24
  • 世界杯五大未解之谜,第五个你最关心,但一样没答案 2019-02-10
  • 一语惊坛(6月12日):五大福利惠及大民生,上合青岛峰会与你我息息相关! 2019-02-10
  • 德国极右翼政党高级别领导人在河里游泳 结果衣服被人偷了…… 2019-01-30
  • 科教 —频道 春城壹网 七彩云南 一网天下 2019-01-30
  • 演员张译:我想我从小就是个好色之徒有故事的人 2019-01-27
  • 权威!个税起征点提至每月5000元,财政部最新解释来了 2019-01-23
  • 果皮-热门标签-华商生活 2019-01-10
  • 微博大数据:海信强势领跑世界杯“中国赞助队” 2018-08-23
  • 中国资本市场开放出大招 跨境证券投资更便利 2018-08-23
  • 朝鲜播长篇“金特会”纪录片,称金正恩为“杰出的世界领袖” 2018-08-21
  • 806| 972| 578| 226| 751| 681| 701| 399| 519| 414|