Table
Simply add the .table
CSS class to a <table>
element, following this structure:
table
the main containerthead
the optional top part of the tabletfoot
the optional bottom part of the tabletbody
the main content of the tabletr
each table rowth
a table cell headingtd
a table cell
<table class="table">
<thead>
<tr>
<th>#</th>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</thead>
<tfoot>
<tr>
<th>#</th>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>1</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
<td>Item data</td>
</tr>
<tr>
<td>2</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
<td>Item data</td>
</tr>
<tr>
<td>3</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
<td>Item data</td>
</tr>
</tbody>
</table>
Modifiers
is-bordered
is-striped
is-narrow
is-hoverable
is-fullwidth
Bordered
<table class="table is-bordered">
<thead>
<tr>
<th>#</th>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tfoot>
<tr>
<th>#</th>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>1</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
</tr>
<tr>
<td>2</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
</tr>
<tr>
<td>3</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
</tr>
</tbody>
</table>
Striped
<table class="table is-striped">
<thead>
<tr>
<th>#</th>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tfoot>
<tr>
<th>#</th>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>1</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
</tr>
<tr>
<td>2</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
</tr>
<tr>
<td>3</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
</tr>
</tbody>
</table>
Narrow
<table class="table is-narrow">
<thead>
<tr>
<th>#</th>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</thead>
<tfoot>
<tr>
<th>#</th>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>1</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
<td>Item data</td>
</tr>
<tr>
<td>2</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
<td>Item data</td>
</tr>
<tr>
<td>3</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
<td>Item data</td>
</tr>
</tbody>
</table>
Hoverable
<table class="table is-hoverable">
<thead>
<tr>
<th>#</th>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</thead>
<tfoot>
<tr>
<th>#</th>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>1</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
<td>Item data</td>
</tr>
<tr>
<td>2</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
<td>Item data</td>
</tr>
<tr>
<td>3</td>
<td>Item data <small>Secondary text</small></td>
<td>Item data <span class="is-secondary">Small description</span></td>
<td>Item data</td>
</tr>
</tbody>
</table>
Variables
Name | Type | Value | Computed value |
---|---|---|---|
$table-cell-heading-bg-color | color | $grey-lighter | rgb(242, 242, 242) |
$table-cell-heading-font-weight | font-weight | $weight-bold | 700 |
$table-cell-heading-border-width | sizes | 0 0 1px | |
$table-cell-heading-color | color | $darker-grey | rgb(85, 85, 85) |
$table-cell-heading-color | color | $darker-grey | rgb(85, 85, 85) |
$table-cell-color | color | $black | rgb(0, 0, 0) |
$table-head-cell-border-width | sizes | 0 0 1px | |
$table-head-cell-color | color | $darker-grey | rgb(85, 85, 85) |
$table-foot-cell-border-width | sizes | 1px 0 0 | |
$table-foot-cell-color | color | $darker-grey | rgb(85, 85, 85) |
$table-cell-border | color | 1px solid rgb(223, 227, 230) | |
$table-cell-border-width | sizes | 0 0 1px | |
$table-cell-padding | sizes | 1.125em 1em | |
$table-cell-secondary-text-font-size | size | .875em | |
$table-cell-secondary-text-color | size | rgb(90, 104, 114) | |
$table-striped-row-even-background-color | size | rgb(249, 252, 255) | |
$table-row-hover-background-color | color | $grey-lighter | rgb(242, 242, 242) |