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.z4f0.com <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-05-21
  • 中国首位“地球卫士终身成就奖”得主诞生! 2019-05-20
  • 看好啦!是时候表演真正的技术了 2019-05-16
  • 端午假期国内游客超8900万人次 全域旅游见成效 2019-05-16
  • 中纪委:不做违规公务接待的“制造者”和“笑纳者” 2019-05-11
  • 石家庄进一步放宽跨省异地就医住院条件 2019-05-11
  • 浙江现奇葩“失恋展” 2019-05-09
  • 哈洽会华南城分会场暨俄罗斯风情文化节启幕 2019-04-28
  • 第25小时 X章元一这一次请不要猜测我的身份 2019-04-25
  • 中沙联合发布月球图像 探月国际合作取得新成果 2019-04-25
  • 伊万卡推文上的那句中国谚语,到底啥意思? 2019-04-14
  • 高清:中国男篮抵达洛杉矶 长途飞行队员略显疲惫 2019-04-14
  • 紧盯节点,打赢反“四风”持久战(前沿观察) 2019-04-06
  • 太阳是宇宙加油站?不明物体多次靠近“加油”,看清后屏住呼吸 2019-03-30
  • 传统产业更新 新兴产业做大 2019-03-18
  • 151| 41| 278| 339| 842| 965| 243| 230| 604| 925|