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 |
This element includes the global attributes.
align
Deprecated since HTML4.01 Obsolete since HTML5
left
, displayed to the left of the tabletop
, displayed before the the tableright
, displayed to the right of the tablebottom
, displayed under the table<caption>
element should be styled using CSS. To give a similar effect to the align
attribute, use the the CSS properties caption-side
and text-align
.When the <table>
element that is the parent of this <caption>
is the only descendant of a <figure>
element, use the <figcaption>
element instead.
Please see the <table>
page for examples on <caption>
Specification | Status | Comment |
---|---|---|
WHATWG 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 |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | 1.0 (1.7 or earlier) | (Yes) | (Yes) | (Yes) |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | 1.0 (1.0) | (Yes) | (Yes) | (Yes) |
<col>
, <colgroup>
, <table>
, <tbody>
, <td>
, <tfoot>
, <th>
, <thead>
, <tr>
;<caption>
element:
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption