CSS caption-side Property
The caption-side property specifies where a table caption is positioned in relation to the main table body.
Possible Values
- top - the caption is placed above the table - this is the default setting.
- bottom - the caption is placed below the table.
- inherit - the caption position is inherited from the parent element.
The default position for the caption is above the table in the center. To change the horizontal alignment of the caption use the
text-align property.
Here are three examples of caption-side in use:
{caption-side: bottom;}
| Column 1 Row 1 | Column 2 Row 1 | Column 3 Row 1 | Column 4 Row 1 |
| Column 1 Row 2 | Column 2 Row 2 | Column 3 Row 2 | Column 4 Row 2 |
{caption-side: bottom; text-align: left;}
| Column 1 Row 1 | Column 2 Row 1 | Column 3 Row 1 | Column 4 Row 1 |
| Column 1 Row 2 | Column 2 Row 2 | Column 3 Row 2 | Column 4 Row 2 |
{caption-side: top; text-align: right}
| Column 1 Row 1 | Column 2 Row 1 | Column 3 Row 1 | Column 4 Row 1 |
| Column 1 Row 2 | Column 2 Row 2 | Column 3 Row 2 | Column 4 Row 2 |
