The HTML <caption> element represents the title of a table. Though it is always the first descendant of a <table>, its styling, using CSS, may place it elsewhere, relative to the table.
| Content categories | None. |
|---|---|
| Permitted content | Flow content. |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents | A <table> element, as its first descendant. |
| Permitted ARIA roles | None |
| DOM interface | HTMLTableCaptionElement |
Attributes
This element includes the global attributes.
alignDeprecated since HTML4.01 Obsolete since HTML5- This enumerated attribute indicates how the caption must be aligned with respect to the table. It may have the following values:
left, displayed to the left of the tabletop, displayed before the the tableright, displayed to the right of the tablebottom, displayed under the table
Usage note: Do not use this attribute, as it has been deprecated: the<caption>element should be styled using CSS. To give a similar effect to thealignattribute, use the CSS propertiescaption-sideandtext-align.
Usage notes
When the <table> element that is the parent of this <caption> is the only descendant of a <figure> element, use the <figcaption> element instead.
Examples
Please see the <table> page for examples on <caption>
Specifications
| Specification | Status | Comment |
|---|---|---|
| HTML Living Standard The definition of '<caption>' in that specification. |
Living Standard | |
| HTML5 The definition of '<caption>' in that specification. |
Recommendation | |
| HTML 4.01 Specification The definition of '<caption>' in that specification. |
Recommendation |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
| Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|---|
| Basic Support | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
align | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
| Feature | Android | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
|---|---|---|---|---|---|---|---|
| Basic Support | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
align | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |

