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”;

Author

  • Manoj Kumar

    Hi, My name is Manoj Kumar. I am a full-stack developer with a passion for creating robust and efficient web applications. I have hands-on experience with a diverse set of technologies, including but not limited to HTML, CSS, JavaScript, TypeScript, Angular, Node.js, Express, React, and MongoDB.

Leave a Comment