Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

communitycreator
css
html
caption

What is the CSS caption-side property?

Behzad Ahmad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The caption-side property in CSSCascading Style Sheets is used to define the place where you want your caption to be placed in a table. It is only used in HTML tables.

Syntax

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

Property values

  • top: This places the caption above the table.

  • bottom: This places the caption below the table.

  • initial: This sets the value to its default value.

  • inherit: This inherits property from its parent value.

Code

The following is the basic HTMLHypertext Markup Language and CSS code to demonstrate the use of the caption-side property.

Explanation

In this example we have made a table that contains the details of an employee. We set the caption to be placed at the top so we can see that the caption is placed at the top. We can also place the caption at the bottom of the table instead of placing it at the top.

RELATED TAGS

communitycreator
css
html
caption

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring