CSS Portal

HTML <caption> Tag

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The <caption> element in HTML is used to provide a title or a descriptive caption for a <table>. It is placed immediately after the opening <table> tag and is intended to give context to the data presented within the table. By offering a caption, it helps users understand the purpose or content of the table without having to examine all the rows and columns, improving accessibility and clarity.

Visually, browsers typically render the caption above the table by default, centered horizontally. This placement, however, can be customized using CSS, allowing the caption to appear below, left, or right of the table if desired. Semantically, the <caption> element enhances the structure of the document, providing screen readers and other assistive technologies with a clear description of the table’s content, which is especially valuable for complex or data-heavy tables.

It is important to note that each <table> can have at most one <caption>, and while it is optional, including one is considered best practice for accessibility and usability. The <caption> element can contain text or inline HTML elements like <strong>, <em>, or links to provide additional emphasis or context.

Properties

Permitted Parents
A <table> element, as its first descendant
Content
Inline and text
Start/End Tags
Start tag: required, End tag: required

Example

<table border="1">
<caption>Monthly savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>

Attributes

align
Specifies the alignment of the caption.
Possible Values:
  • left
  • right
  • top
  • bottom

Global Attributes

The <caption> tag also supports the Global Attributes in HTML5

Event Attributes

The <caption> tag also supports the Event Attributes in HTML5

Browser Support

The following information will show you the current browser support for the HTML <caption> tag. Hover over a browser icon to see the version that first introduced support for this HTML tag.

This tag is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 26th December 2025

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!