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.b9l5.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-04-16
  • 忻州 端午节假期旅游收入达59962万元--黄河新闻网 2019-04-15
  • 股市涨跌都正常,但不能允许欺诈,反正欺诈发现了,国家可以罚款,但股民就白损失了,这是什么规矩? 2019-04-10
  • 中央环保督察“回头看”10省区问责630人 2019-04-07
  • 人民网舆情分析专家:杨卫娜 2019-04-01
  • 湖南《当代商报》工作人员戴石宗在家中遇害,嫌犯已落网 2019-04-01
  • 习近平:携手追寻中澳发展梦想 并肩实现地区繁荣稳定 2019-04-01
  • 土地红线不断的下降,农民却越吃越饱,中国农民是一只神的力量,会魔法 2019-04-01
  • 城市规划研究回归人本主义——巴塞罗那城市道路改造 2019-03-29
  • 从经济数据看民生获得感 2019-03-29
  • 足球界最丑十大球星:小罗第4!鲁尼第3 里贝里仅第6! ——凤凰网房产 2019-03-25
  • 改革开放40年——金羊网专题 2019-03-24
  • 第七届“重庆与世界嘉年华”开幕 50余个活动展现重庆城市魅力 2019-03-24
  • 法制日报:私人影院不能成盗版温床 2019-03-19
  • 女性之声——全国妇联 2019-03-19
  • 980| 153| 316| 718| 600| 598| 249| 793| 497| 453|