Bootstrap CSS 表参考


<表> 类

使用下面的类来设置任何表格的样式:

Class Description Example
.table Adds basic styling (light padding and only horizontal dividers) to any <table> 尝试一下
.table-striped Adds zebra-striping to any table row within <tbody> (not available in IE8) 尝试一下
.table-bordered Adds border on all sides of the table and cells 尝试一下
.table-hover Enables a hover state on table rows within a <tbody> 尝试一下
.table-condensed Makes table more compact by cutting cell padding in half 尝试一下
Combining all the table classes 尝试一下

<tr>、<th> 和 <td> 类

使用下面的类为表格行或单元格着色:

Class Description Example
.active Applies the hover color (light-grey) to a particular row or cell 尝试一下
.success Indicates a successful or positive action 尝试一下
.info Indicates a neutral informative change or action 尝试一下
.warning Indicates a warning that might need attention 尝试一下
.danger Indicates a dangerous or potentially negative action 尝试一下

响应表

.table-responsive 类创建一个响应式表。然后,表格将在小型设备(768 像素以下)上水平滚动。在宽度大于 768px 的任何物体上查看时,没有区别:

示例

<div class="table-responsive">
  <table class="table">
    ...
  </table>
</div>
亲自试一试 »