caption

< html‎ | elements
Jump to: navigation, search

caption

This article is In Progress.


W3C Candidate Recommendation

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.

HTML information

Closing tags are required. CSS display is inline.


Compatibility

Do you think this data can be improved? You can ask to add by opening an issue or make a pull request.

Desktop

FeaturesChromeFirefoxInternet ExplorerOperaSafari
Basic support
?
Yes
1.0
Yes
?
Yes
?
Yes
?
Yes

Mobile

FeaturesAndroidFirefox MobileIE MobileOpera MobileSafari Mobile
Basic support
?
Yes
1.0
Yes
?
Yes
?
Yes
?
Yes

Examples

View live exampleThis example uses the caption element to provide a brief description for a table.

HTML


<table>
 <caption>Characteristics with positive and negative sides</caption>
 <thead>
  <tr>
   <th> Characteristic
   <th> Negative
   <th> Positive
 <tbody>
  <tr>
   <th> Mood
   <td> Sad
   <td> Happy
  <tr>
   <th> Grade
   <td> Failing
   <td> Passing
</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

Specification Status Related Changes
HTML5 - 4.9 Tabular Data W3C Candidate Recommendation

See also

Related articles

HTML

































  • caption


















… further results

Text







































  • caption












… further results


External resources

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