Tables

Documentation and examples for opt-in styling of tables (given their prevalent use in JavaScript plugins) with Bootstrap.

Example

Using the most basic table markup, here’s how .table-based tables look in Bootstrap.

#FirstLastHandle
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
HTML
<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>Mark</td>      <td>Otto</td>      <td>@mdo</td>    </tr>    <tr>      <th scope="row">2</th>      <td>Jacob</td>      <td>Thornton</td>      <td>@fat</td>    </tr>    <tr>      <th scope="row">3</th>      <td colspan="2">Larry the Bird</td>      <td>@twitter</td>    </tr>  </tbody></table>

Variants

Use contextual classes to color tables, table rows or individual cells.

ClassHeadingHeading
DefaultCellCell
PrimaryCellCell
SecondaryCellCell
SuccessCellCell
DangerCellCell
WarningCellCell
InfoCellCell
LightCellCell
DarkCellCell
HTML
<!-- On tables --><table class="table-primary">...</table><table class="table-secondary">...</table><table class="table-success">...</table><table class="table-danger">...</table><table class="table-warning">...</table><table class="table-info">...</table><table class="table-light">...</table><table class="table-dark">...</table><!-- On rows --><tr class="table-primary">...</tr><tr class="table-secondary">...</tr><tr class="table-success">...</tr><tr class="table-danger">...</tr><tr class="table-warning">...</tr><tr class="table-info">...</tr><tr class="table-light">...</tr><tr class="table-dark">...</tr><!-- On cells (`td` or `th`) --><tr>  <td class="table-primary">...</td>  <td class="table-secondary">...</td>  <td class="table-success">...</td>  <td class="table-danger">...</td>  <td class="table-warning">...</td>  <td class="table-info">...</td>  <td class="table-light">...</td>  <td class="table-dark">...</td></tr>

Striped rows

Use .table-striped to add zebra-striping to any table row within the tbody.

#FirstLastHandle
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter

Striped columns

Use .table-striped-columns to add zebra-striping to any table column.

#FirstLastHandle
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter

Dark

#FirstLastHandle
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter

Dark columns

#FirstLastHandle
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter

Table Success

#FirstLastHandle
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
table striped
<table class="table table-striped">  ...</table>
table- striped columns
<table class="table table-striped-columns">  ...</table>
dark striped
<table class="table table-dark table-striped">  ...</table>
dark striped columns
<table class="table table-dark table-striped-columns">  ...</table>
success
<table class="table table-success table-striped">  ...</table>

Hoverable

Add .table-hover to enable a hover state on table

#FirstLastHandle
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
HTML
<table class="table table-hover">  ...</table>

Table borders

Add .table-bordered for borders on all sides of the table and cells.

#FirstLastHandle
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
HTML
<table class="table table-bordered">  ...</table>

Table head

Similar to tables and dark tables, use the modifier classes .table-light or .table-dark to make thead s appear light or dark gray.

#FirstLastHandle
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
#FirstLastHandle
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
light
<table class="table">  <thead class="table-light">    ...  </thead>  <tbody>    ...  </tbody></table>
dark
<table class="table">  <thead class="table-dark">    ...  </thead>  <tbody>    ...  </tbody></table>

Sizing

Add .table-sm to make any .table more compact by cutting all cell padding in half.

#FirstLastHandle
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
html
<table class="table table-sm">  ...</table>
Recent Notification