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.

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

Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? ? ? ? ?

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic support ? ? ? ? ? ? ? ?

See also

Related articles

HTML































  • caption




















… further results

Text







































  • caption












… further results


External resources

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