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.wzyo0.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-22
  • 通用在美召回11.2万雪佛兰科鲁兹 解决漏油隐患 2019-03-21
  • 【中国梦·大国工匠篇】 “跨界”复苏失传百年工艺 蔺涛:坚守让古砚焕发新生 2019-03-21
  • 《2016年社会治理舆情报告》在京发布 2019-02-12
  • 呵呵。。。你这是没有耐力和极不对称的高手。真正的高手过招会有很多的精彩回合。 2019-02-12
  • 人民观影团:李晨自导自演《空天猎》 范冰冰展空军风采 2019-02-05
  • 广东摧毁全国首例“呼死你”犯罪团伙 2019-02-05
  • 打开水龙头流出“鲜橙多” 南昌县这个小区神了! 2019-01-30
  • 上万假药成本仅几十 女子欲毁罪证扔下10斤重肉毒素 2019-01-30
  • 报道新闻记录历史 70载人民日报见证中国发展大事 2019-01-27
  • 习近平主持上海合作组织青岛峰会小范围会谈 2019-01-27
  • 人民日报为人民,70年办报不容易,办报人付出了心血和汗水,记录了中国的发展过程,祝愿办得越来越好! 2019-01-20
  • 微软被曝正在研发零售店中的免结账技术,挑战亚马逊无人商店 2019-01-20
  • 新飞行员开飞挑战“高险难” 试训滑跑起降课目 2019-01-02
  • 海淀区西三旗地区2000余人共享首届冰雪欢乐节 2019-01-02
  • 897| 865| 833| 426| 197| 521| 89| 581| 117| 156|