This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

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