CSS caption-side Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Tables & Layout

What You’ll Learn

The caption-side property controls where a table caption appears — above or below the table. It helps you label data clearly and improve table readability and accessibility.

01

Caption Placement

Top or bottom of table.

02

Syntax

top, bottom, inherit.

03

caption Tag

Works with HTML tables.

04

Default top

Caption above table.

05

Styling

Pair with font rules.

06

Accessibility

Describe table purpose.

Definition and Usage

The caption-side CSS property controls the placement of table captions. It lets you specify whether the caption should appear at the top or the bottom of a table.

This property is particularly useful for enhancing the readability and accessibility of table data by clearly labeling the table’s purpose or contents. Use it with the HTML <caption> element inside a <table>.

💡
Beginner Tip

Most tables use caption-side: top (the default) so users see the title before the data. Use bottom when the caption reads like a footnote or data source note.

📝 Syntax

Apply caption-side to the <caption> element or with a caption selector:

syntax.css
caption {
  caption-side: top | bottom;
}

Basic Example

caption-side.css
caption {
  caption-side: bottom;
}

Syntax Rules

  • The initial value is top.
  • Applies to table caption elements.
  • Only affects tables that include a <caption> element.
  • The property is inherited, so you can set it on a parent and use inherit on captions.
  • Style the caption text separately with font-weight, color, and text-align.

⚡ Quick Reference

QuestionAnswer
Initial valuetop
Applies toTable caption elements
InheritedYes
AnimatableNo
Common usePosition table titles and source notes

💎 Property Values

The caption-side property accepts keyword values that control vertical caption placement.

ValueExampleMeaning
topcaption-side: top;Places the caption above the table. This is the default value.
bottomcaption-side: bottom;Places the caption below the table.
inheritcaption-side: inherit;Inherits the caption-side value from the parent element.
top — above (default) bottom — below

The caption Element

Every styled caption starts with correct HTML structure. Place <caption> as the first child inside <table>:

table-caption.html
<table>
  <caption>Monthly sales summary</caption>
  <thead>
    <tr><th>Month</th><th>Revenue</th></tr>
  </thead>
  <tbody>
    <tr><td>Jan</td><td>$1,200</td></tr>
  </tbody>
</table>

Then use caption-side in CSS to move the caption above or below the table box. The caption text itself should describe what the table contains — not just repeat column headers.

👀 Live Preview

Compare the default top placement with bottom on otherwise identical tables.

caption-side: top

Sales by region
RegionTotal
North$4,200
South$3,800

caption-side: bottom

Source: Q1 report
RegionTotal
North$4,200
South$3,800

Examples Gallery

Try bottom captions, default top placement, styled captions, and per-table positioning.

📋 Caption Placement

Switch between top and bottom placement — starting with the reference example that puts the caption below the table.

Example 1 — Caption at the Bottom

Place the caption below the table using caption-side: bottom.

caption-bottom.html
<style>
  caption {
    caption-side: bottom;
  }
</style>

<table border="1">
  <caption>This is a table caption</caption>
  <tr>
    <th>Header 1</th>
    <th>Header 2</th>
  </tr>
  <tr>
    <td>Data 1</td>
    <td>Data 2</td>
  </tr>
</table>
Try It Yourself

How It Works

The caption renders below the table border box instead of above it. The HTML still places <caption> first in the markup — CSS controls the visual position.

Example 2 — Caption at the Top (Default)

Explicitly set caption-side: top for a standard title-above-table layout.

caption-top.html
<style>
  caption {
    caption-side: top;
    font-weight: bold;
    margin-bottom: 0.5rem;
  }
</style>

<table>
  <caption>Employee directory</caption>
  <tr><th>Name</th><th>Role</th></tr>
  <tr><td>Alex</td><td>Designer</td></tr>
</table>
Try It Yourself

How It Works

top is the default, but setting it explicitly documents your intent and pairs well with caption styling like bold text and spacing.

🎨 Styled Captions

Combine caption-side with typography and alignment for polished data tables.

Example 3 — Styled Bottom Caption as a Source Note

Style a bottom caption to look like a subtle data source footnote.

styled-caption.html
<style>
  .data-table caption {
    caption-side: bottom;
    font-size: 0.8125rem;
    color: #64748b;
    text-align: left;
    padding-top: 0.5rem;
  }
</style>

<table class="data-table">
  <caption>Source: Internal analytics, March 2026</caption>
  <tr><th>Metric</th><th>Value</th></tr>
  <tr><td>Visitors</td><td>12,400</td></tr>
</table>
Try It Yourself

How It Works

Bottom placement plus smaller gray text makes the caption read as supplementary information rather than a main heading.

Example 4 — Different Caption Positions per Table

Assign different classes to control caption placement on individual tables.

multiple-captions.html
<style>
  .caption-top caption { caption-side: top; }
  .caption-bottom caption { caption-side: bottom; }
</style>

<table class="caption-top">
  <caption>Title above</caption> ...
</table>

<table class="caption-bottom">
  <caption>Note below</caption> ...
</table>
Try It Yourself

How It Works

Scoping rules to table wrapper classes lets one page mix title-style top captions and footnote-style bottom captions.

♿ Accessibility

  • Always use a caption — Screen readers announce the caption to give context before reading cell data.
  • Write descriptive text — Explain what the table shows, not just “Table 1.”
  • Placement is visual — Moving the caption with CSS does not change reading order for assistive technology in most browsers; the caption remains associated with the table.
  • Do not rely on color alone — Caption styling should remain readable with sufficient contrast.

🧠 How caption-side Works

1

You add a caption element

Include <caption> inside the table with meaningful descriptive text.

HTML structure
2

You set caption-side in CSS

Choose top or bottom to control vertical placement.

CSS rule
3

The browser positions the caption box

The caption is rendered above or below the table grid while staying part of the table structure.

Table layout
=

Clear table labeling

Users immediately understand what the table data represents.

Universal Browser Support

The caption-side property is widely supported across all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera.

Baseline · All browsers

Dependable caption placement everywhere

Chrome, Firefox, Safari, Edge, and Opera all support caption-side: top and bottom.

99% Universal support
Google Chrome 1+ · Desktop & Mobile
Full support
Mozilla Firefox 1+ · Desktop & Mobile
Full support
Apple Safari 1+ · macOS & iOS
Full support
Microsoft Edge 12+ · All versions
Full support
Opera 4+ · Modern versions
Full support
caption-side property 99% supported

Bottom line: Use caption-side freely for table captions. It is one of the most reliable table-related CSS properties.

Conclusion

The caption-side property is a useful tool for controlling the placement of table captions. By specifying whether the caption should appear at the top or the bottom of the table, you can enhance the readability and organization of your table data.

Experiment with this property to see how it can improve the presentation of your tables — especially when pairing top captions with titles and bottom captions with source notes.

💡 Best Practices

✅ Do

  • Include a <caption> on every data table
  • Use top for main table titles
  • Use bottom for source notes and footnotes
  • Style captions for readability with font-size and color
  • Write captions that describe the table’s purpose

❌ Don’t

  • Skip the caption and rely only on nearby headings
  • Use vague caption text like “Table” or “Data”
  • Assume caption-side replaces proper table headers
  • Hide captions visually while leaving empty caption tags
  • Forget that caption-side only works on table caption elements

Key Takeaways

Knowledge Unlocked

Five things to remember about caption-side

Use these points when labeling your next data table.

5
Core concepts
02

top Default

Caption above table.

Default
03

bottom Value

Caption below table.

Keyword
📝 04

caption Tag

Required HTML element.

HTML
05

Accessible

Describe table data.

A11y

❓ Frequently Asked Questions

caption-side controls whether a table caption appears above or below the table. It positions the caption element relative to the table box.
The initial value is top, which places the caption above the table by default.
It applies to table caption elements — the HTML caption tag inside a table. You can also target caption with a CSS selector.
top places the caption above the table headers and data rows. bottom places the caption below the entire table, which can work well for source notes or footnotes.
Yes. A visible, well-placed caption helps all users understand the table purpose. Always use a meaningful caption element rather than relying on caption-side alone for context.

Practice in the Live Editor

Open the HTML editor, apply caption-side, and preview table caption placement instantly.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful