Example
Using the most basic table markup, hereβs how .table
based tables look in Bootstrap.
# | First | Last | Handle |
---|---|---|---|
1 | Steven | Speilberg | @mdo |
2 | Martin | Scorsese | @fat |
3 | James | Cameron | |
4 | John | Doe |
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Steven</td>
<td>Speilberg</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Martin</td>
<td>Scorsese</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td>James</td>
<td>Cameron</td>
<td>@twitter</td>
</tr>
<tr>
<th scope="row">4</th>
<td>John</td>
<td>Doe</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
Variants
Use contextual classes to color tables, table rows or individual cells. Here example of table-info
# | First | Last | Handle |
---|---|---|---|
1 | Steven | Speilberg | @mdo |
2 | Martin | Scorsese | @fat |
3 | James | Cameron | |
4 | John | Doe |
<table class="table table-info">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Steven</td>
<td>Speilberg</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Martin</td>
<td>Scorsese</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td>James</td>
<td>Cameron</td>
<td>@twitter</td>
</tr>
<tr>
<th scope="row">4</th>
<td>John</td>
<td>Doe</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
Striped
# | First | Last | Handle |
---|---|---|---|
1 | Steven | Speilberg | @mdo |
2 | Martin | Scorsese | @fat |
3 | James | Cameron | |
4 | John | Doe |
<table class="table table-striped">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Steven</td>
<td>Speilberg</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Martin</td>
<td>Scorsese</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td>James</td>
<td>Cameron</td>
<td>@twitter</td>
</tr>
<tr>
<th scope="row">4</th>
<td>John</td>
<td>Doe</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
Table Hover
# | First | Last | Handle |
---|---|---|---|
1 | Steven | Speilberg | @mdo |
2 | Martin | Scorsese | @fat |
3 | James | Cameron | |
4 | John | Doe |
<table class="table table-hover">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Steven</td>
<td>Speilberg</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Martin</td>
<td>Scorsese</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td>James</td>
<td>Cameron</td>
<td>@twitter</td>
</tr>
<tr>
<th scope="row">4</th>
<td>John</td>
<td>Doe</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
Dark
Using the most basic table markup, hereβs how .table-dark
based tables look in Bootstrap.
# | First | Last | Handle |
---|---|---|---|
1 | Steven | Speilberg | @mdo |
2 | Martin | Scorsese | @fat |
3 | James | Cameron | |
4 | John | Doe |
<table class="table table-dark">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Steven</td>
<td>Speilberg</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Martin</td>
<td>Scorsese</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td>James</td>
<td>Cameron</td>
<td>@twitter</td>
</tr>
<tr>
<th scope="row">4</th>
<td>John</td>
<td>Doe</td>
<td>@twitter</td>
</tr>
</tbody>
</table>