Tables are primarily used to arrange a lot of different data into rows and columns.

Basic Example

For basic styling—light padding and only horizontal dividers—add the base class .table to any <table>.

Examples:

Carbs (g) Protein (g) Sodium (mg) Calcium %... Iron %...
24 4.0 87 14% 1%
37 4.3 129 8% 1%
24 6.0 337 6% 7%

HTML Code:

Basic Table with Checkbox

Examples:

Carbs (g) Protein (g) Sodium (mg) Calcium %... Iron %...
24 4.0 87 14% 1%
37 4.3 129 8% 1%
24 6.0 337 6% 7%

HTML Code:

Stripped Rows

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

Examples:

Carbs (g) Protein (g) Sodium (mg) Calcium %... Iron %...
24 4.0 87 14% 1%
37 4.3 129 8% 1%
24 6.0 337 6% 7%

HTML Code:

Bordered Table

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

Examples:

Carbs (g) Protein (g) Sodium (mg) Calcium %... Iron %...
24 4.0 87 14% 1%
37 4.3 129 8% 1%
24 6.0 337 6% 7%

HTML Code:

Hover Rows

Add .table-hover to enable a hover state on table rows within a <tbody>.

Examples:

Carbs (g) Protein (g) Sodium (mg) Calcium %... Iron %...
24 4.0 87 14% 1%
37 4.3 129 8% 1%
24 6.0 337 6% 7%

HTML Code:

Condensed Table

Add .table-condensed to make tables more compact by cutting cell padding in half.

Examples:

Carbs (g) Protein (g) Sodium (mg) Calcium %... Iron %...
24 4.0 87 14% 1%
37 4.3 129 8% 1%
24 6.0 337 6% 7%

HTML Code:

Contextual Classes

Use contextual classes to color table rows or individual cells.

Examples:

# Column heading Column heading Column heading
1 Column content Column content Column content
2 Column content Column content Column content
3 Column content Column content Column content
4 Column content Column content Column content
5 Column content Column content Column content
6 Column content Column content Column content
7 Column content Column content Column content
8 Column content Column content Column content
9 Column content Column content Column content

HTML Code: