The <caption> specifies the caption (or title) of a table.

Content categories None.
Permitted content Flow content.
Tag omission The end tag can be omitted if the element is not immediately followed by ASCII whitespace or a comment.
Permitted parents A <table> element, as its first descendant.
Implicit ARIA role No corresponding role
Permitted ARIA roles No role permitted
DOM interface HTMLTableCaptionElement


This element includes the global attributes.

Deprecated attributes

The following attributes are deprecated and should not be used. They are documented below for reference when updating existing code and for historical interest only.

This enumerated attribute indicates how the caption must be aligned with respect to the table. It may have one of the following values:
The caption is displayed to the left of the table.
The caption is displayed above the table.
The caption is displayed to the right of the table.
The caption is displayed below the table.
Usage note: Do not use this attribute, as it has been deprecated. The <caption> element should be styled using the CSS properties caption-side and text-align.

Usage notes

The <caption> element should be the first child of its parent <table> element.

When the <table> element that contains the <caption> is the only descendant of a <figure> element, you should use the <figcaption> element instead of <caption>.


This simple example presents a table that includes a caption.

  <caption>Example Caption</caption>
    <td>[email protected]</td>
    <td>[email protected]</td>

table {background: red;} do not alter caption. For that you need display: block.


Browser compatibilityUpdate compatibility data on GitHub

Chrome Edge Firefox Internet Explorer Opera Safari
caption Yes 12 1 Yes Yes Yes
align Yes 12 1 Yes Yes Yes
Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
caption Yes Yes 4 Yes Yes Yes
align Yes Yes 4 Yes Yes Yes

See also

© 2005–2020 Mozilla and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.