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.xw6il.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-06-13
  • 所以,历史注定苏联模式是他的第一次浪潮的结束,第二次浪潮的发端。 2019-06-13
  • 人民日报发喜报庆祝我国第一颗氢弹爆炸成功 2019-06-12
  • 中央组织部划拨中管党费用于纪念建党95周年走访慰问老党员和生活困难党员 2019-06-06
  • 湖南衡阳警方:辅警并未与当事人车辆接触而倒地 已停职调查 2019-06-06
  • 智慧乌镇“互联网+”闪耀中国点亮世界 2019-05-27
  • 给孩子们更多本土精品读本 2019-05-27
  • 在“街角博物馆”中找寻来自唐朝的“雕刻时光” 2019-05-19
  • 【思客问答】关于两会,你想问的都在这里! 2019-05-19
  • 纪念人民日报创刊70周年 重温历史动人瞬间 2019-05-10
  • 2000年出生的孩子属龙,要风得风,要雨得雨 2019-05-10
  • 端午出行走雅康高速 请先看看这份出行指南 2019-04-12
  • 特色小镇里的税收服务 定海国地税多措并举提升效能 2019-04-08
  • 广东丰顺警方通报:男子疑因家庭矛盾杀害其妻和两孙女后自杀 2019-03-29
  • 国务院允许符合条件外国自然人投资境内上市公司 2019-03-29
  • 118| 546| 172| 939| 971| 273| 693| 253| 484| 908|