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.0yi90.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-21
  • 港珠澳大桥港澳跨境巴士将运营 料载客量80%以上 2019-03-20
  • 紫光阁中共中央国家机关工作委员会 2019-03-20
  • 真格基金前美女公关经理:被陌生人性骚扰3年 今天决定不忍了! 2019-03-19
  • 青海甘德县:把党的十九大精神送到牧民群众家门口 2019-03-19
  • 白糖久放会滋生螨虫?这是真的!购买时尽量选择日期新鲜的 2019-03-19
  • 2026世界杯花落北美三国 2019-03-19
  • Calligraphy and Painting 2019-03-18
  • 三问抗癌药窘境:供不应求?降价慢?倒逼创新? 2019-03-18
  • 5G标准出炉!与4G有啥不一样?或1秒内下载1G电影 2019-03-18
  • 人民日报评论员:共同描绘历史新阶段的发展蓝图 2019-03-18
  • 浙江省新闻道德委员会举报中心投诉电话、网络安全举报电话 2019-03-17
  • 【90期】裴勇:致敬太虚大师!真心不坏 潮音永亮 2019-03-17
  • 换装就飞战术应用课目 2019-03-17
  • 聚焦2017年乌鲁木齐市老城区改造提升工程 2019-03-16
  • 448| 608| 908| 479| 544| 645| 123| 718| 804| 141|