Specifies the position of a caption with respect to its parent table.
CSS |
{ caption-side : top | bottom } |
Script |
table.style.captionSide = top | bottom |
top |
The caption is positioned at the top of the table. |
bottom |
The caption is positioned at the bottom of the table. |
The property is read/write with a default value of top; the CSS property is not inherited.
A table caption by default is center-aligned at the top of a table.
The caption-side property can be used, though, to set the position of the caption.
In addition, the text-align CSS property can be used to align the content of the caption.
This example shows the effects of applying CSS to set the position and alignment of a <caption> element.
Show me
CAPTION
border-collapse border-spacing table-layout