This page is Almost Ready

Notice: The WebPlatform project has been discontinued when the Stewards partnership agreement ended in September 2015. This site has been frozen, and the assets we have created will remain.

caption

Summary

The caption (<caption>) element represents the title of the table that is its parent.

Overview Table

DOM Interface
HTMLTableCaptionElement

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>

View live example

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

HTML 5.1
W3C Working Draft
HTML 5
W3C Recommendation
HTML 4.01
W3C Recommendation

See also

Related articles

HTML

Text

External resources

http://www.w3.org/wiki/HTML/Elements/caption