CSS caption-side Property

CSS caption-side property specifies where the caption of a table should be placed. The table caption can either be placed at the top or bottom of the table. See implementation in the example below:

Example:

.table1{
  caption-side: top;
}
.table2{
  caption-side: bottom;
}

CSS Syntax

The caption-side property has the below syntax:

caption-side: top|bottom|initial|inherit;

Property Values

The caption-side property accepts the following values:

topThis is the default value. The caption is placed just above the table.
bottomThe caption is placed just below the table.
initialSets the caption-side property to its default value(top).
inheritInherits the caption-side property from the parent element.

General Info

Default Valuetop
InheritedYes
JavaScript Usageelement.style.captionSide = “bottom”;