caption
Summary
The caption (<caption>) element represents the title of the table that is its parent.
Overview Table
The caption element (<caption>) specifies a brief description for a table. The <caption> element must be inserted immediately after the <table> element.
Examples
This example uses the caption element to provide a brief description for a table.
<table>
<caption>Characteristics with positive and negative sides</caption>
<thead>
<tr>
<th>Characteristic</th>
<th>Negative</th>
<th>Positive</th>
</tr>
</thead>
<tbody>
<tr>
<th>Mood</th>
<td>Sad</td>
<td>Happy</td>
</tr>
<tr>
<th>Grade</th>
<td>Failing</td>
<td>Passing</td>
</tr>
</tbody>
</table>
Notes
Remarks
The caption element should be a child of the <table> element.
A caption can introduce context for a table, making it significantly easier to understand.
When a table element is the only content in a figure element other than the figcaption, the caption element should be omitted in favor of the figcaption.
Related specifications
See also
Related articles
HTML
caption
Text
caption