The HTML Table Caption element (<caption>) specifies the caption (or title) of a table, and if used is always the first child of a <table>. Its styling and physical position relative to the table may be changed using the CSS caption-size and text-align properties.

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.
Permitted ARIA roles None
DOM interface HTMLTableCaptionElement


This element includes the global attributes.

Obsolete attributes

The following attributes are obsolete 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

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>


Specification Status Comment
HTML Living Standard
The definition of '<caption>' in that specification.
Living Standard  
The definition of '<caption>' in that specification.
HTML 4.01 Specification
The definition of '<caption>' in that specification.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support Yes Yes1 Yes Yes Yes
align Yes Yes1 Yes Yes Yes
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes Yes Yes4 Yes Yes ?
align Yes Yes Yes4 Yes Yes ?

See also