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.x4g97.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-23
  • 世界杯亚洲“常客”给中国足球带来的启示 2019-03-23
  • 广州市第十五届人大常委会第十一次会议第二次全体会议 2019-03-23
  • 共产主义劳动不再是谋生手段就是劳动不再是看着就想笑鼓吹私有制下的责权利所谓平滑对接下的为生存而做资本的雇佣劳动奴隶劳动,而是在共产主义公有制里劳动由于一辈子做 2019-03-22
  • 个税法迎第七次大修 起征点调至每年6万元 2019-03-22
  • 离开城市告别妻儿 他陪母亲“归园田居”(图) 2019-03-22
  • 新华社受权播发《中华人民共和国监察法》 2019-03-21
  • 党的自我革命是伟大社会革命的强大动力(深入学习贯彻习近平新时代中国特色社会主义思想) 2019-03-21
  • 中东部地区将有强降雨 京津冀等地有轻至中度霾 2019-03-21
  • 机构改革是一场政治考验 2019-03-21
  • 人身险产品遭遇“负面清单” 保险行业迎供给侧改革 2019-03-20
  • "生死"淘汰赛启动 中国私募股权行业加速洗牌 2019-03-20
  • 第535期:草莓被评“最脏水果”?!真OR假 2019-03-20
  • 当前金融市场流动性合理稳定 2019-03-19
  • [微笑]所谓的卖地,表面上卖的是土地,实际上卖的是关联资源!这就是为什么同样面积的土地处于不同的城市不同的地段,价值可以有云泥之别的原因。 2019-03-19
  • 925| 329| 864| 917| 213| 549| 300| 130| 804| 701|