Name
caption — HTML 4.01 | HTML5
Synopsis
<caption> . . . </caption>
Provides a summary of a table’s contents or purpose. The
caption
element must immediately
follow the table
start tag and
precede all other table elements. The align
attribute is deprecated in favor of
the CSS caption-side
property for
caption positioning.
Note
In HTML5, if a table
is in a
dd
element in a figure
, use the dt
element for the table caption
instead.
Start/End Tags
Required/Required
Attributes
Core, Internationalization, Events, HTML5 Global Attributes
align="top|bottom|left|right"
Deprecated. Not in HTML5. Positions the caption relative to the table. The default position is
top
.
Example
See also table listing.
<table>
<caption>
A brief description of the data in this
table.</caption>
<tr>
<td>data</td><td>data</td>
</tr>
</table>
Get HTML & XHTML Pocket Reference, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.