Tables

Tables include default styles for tables and data sets.

Name Genre Release date
The Shawshank Redemption Crime, Drama 14 October 1994
The Godfather Crime, Drama 24 March 1972
Schindler's List Biography, Drama, History 4 February 1994
Se7en Crime, Drama, Mystery 22 September 1995

Add the table class to any <table> element. The class will add padding, border and emphasized table header.

<table class="table">
  <thead>
    <tr>
      <th>name</th>
      <th>genre</th>
      <th>release date</th>
    </tr>
  </thead>
  <tbody>
    <tr class="active">
      <td>The Shawshank Redemption</td>
      <td>Crime, Drama</td>
      <td>14 October 1994</td>
    </tr>
  </tbody>
</table>

Striped tables

Name Genre Release date
The Shawshank Redemption Crime, Drama 14 October 1994
The Godfather Crime, Drama 24 March 1972
Schindler's List Biography, Drama, History 4 February 1994
Se7en Crime, Drama, Mystery 22 September 1995

Add the table-striped class to <table> to highlight odd rows. For hoverable table rows, you can add the table-hover class to enable hover style.

Use the active class to make <tr> element highlighted. Use the table-striped-even to highlight even rows instead of odd.

Name Genre Release date
The Shawshank Redemption Crime, Drama 14 October 1994
The Godfather Crime, Drama 24 March 1972
Schindler's List Biography, Drama, History 4 February 1994
Se7en Crime, Drama, Mystery 22 September 1995
<table class="table table-striped table-hover">
  <thead>
    <tr>
      <th>name</th>
      <th>genre</th>
      <th>release date</th>
    </tr>
  </thead>
  <tbody>
    <tr class="active">
      <td>The Shawshank Redemption</td>
      <td>Crime, Drama</td>
      <td>14 October 1994</td>
    </tr>
  </tbody>
</table>

Secondary Headings

Tire Wheel Lug
OE Size Serv Desc Bolt Diameter Width Hub Thread
F 275/55R20 111T 6 x 135mm 17" - 24" 5" - 8" 87.1mm 14mm x 1.5 Nut
R 17" - 24" 5" - 8"

<th> elements inside of a <tbody> will get a secondary heading treament.

<table class="table table-striped">
  <thead>
    <tr>
      <th colspan="3">Tire</th>
      <th colspan="4">Wheel</th>
      <th>Lug</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th colspan="2">OE Size</th>
      <th>Serv Desc</th>
      <th>Bolt</th>
      <th>Diameter</th>
      <th>Width</th>
      <th>Hub</th>
      <th>Thread</th>
    </tr>
    <tr>
      <td>F</td>
      <td rowspan="2">275/55R20</td>
      <td rowspan="2">111T</td>
      <td rowspan="2">6 x 135mm</td>
      <td>17" - 24"</td>
      <td>5" - 8"</td>
      <td rowspan="2">87.1mm</td>
      <td rowspan="2">14mm x 1.5 Nut</td>
    </tr>
    <tr>
      <td>R</td>
      <td>17" - 24"</td>
      <td>5" - 8"</td>
    </tr>
  </tbody>
</table>

Responsive tables

# Language People Using Col 0 Col 1 Col 2 Col 3 Col 4 Col 5 Col 6 Col 7 Col 8 Col 9 Col 10 Col 11 Col 12 Col 13 Col 14 Col 15 Col 16 Col 17 Col 18 Col 19
1 JavaScript 1 Billion 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
2 C# 500 Million 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
3 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
4 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
5 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
6 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
7 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
8 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
9 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
10 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
11 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
12 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
13 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
14 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
15 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
16 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
17 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
18 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
19 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
20 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
21 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
22 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
23 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
24 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
25 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
26 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
27 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
28 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
29 PHP 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
30 Fortran -100 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Wrap your table with a table-responsive element to make it respond by scrolling vertically and horizontally. The table will automatically get a max-height, adjust it max-height as needed.

The th cells in your table's thead will become fixed when the table overflows its height. Browsers without position: sticky support will fallback to no sticky-headers. While printing overflow and max-height will be reset. Add the table-sticky-column to every <th> and <td> in a column make the column sticky as well.

<div class="table-responsive">
  <table class="table table-striped table-hover">
    <thead>
      <tr>
        <th class="table-sticky-column">name</th>
        <th>genre</th>
        <th>release date</th>
      </tr>
    </thead>
    <tbody>
      <tr class="active">
        <td class="table-sticky-column">The Shawshank Redemption</td>
        <td>Crime, Drama</td>
        <td>14 October 1994</td>
      </tr>
    </tbody>
  </table>
</div>

Mini tables

Min Max
Width 5" 7"
Diameter 16" 21"

Add the table-mini class to any <table> element. The class will reduce font sizes and padding, and remove the header background.

<table class="table table-mini table-striped-even">
  <thead>
    <tr>
      <th></th>
      <th>Min</th>
      <th>Max</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>Width</th>
      <td>5"</td>
      <td>7"</td>
    </tr>
    <tr>
      <th>Diameter</th>
      <td>16"</td>
      <td>21"</td>
    </tr>
  </tbody>
</table>