Web accessibility tutorials Guidance on how to create websites that meet WCAG
Jump to the navigation

Caption

Status: This is not ready for detailed review. It is an in-progress, unapproved editor’s draft.

A table caption can be used to provide a heading for the table as a hole. This is not required to meet WCAG 2.0, but is considered best practice because the <caption> element is explicitly associated with the table. The <caption> value should be a succinct description of the content of the table.

Examples on the Header cells page use other ways to introduce tables, but this and all other pages in this tutorial apply the <caption> element to tables.

<caption> used as a table heading

This example has the table heading marked up using the <caption> element, its value "Concert dates" tells users what information the table contains.

Example
Concert dates
Date Event Venue
12 Feb Waltz with Strauss Main Hall
24 Mar The Obelisks West Wing
14 Apr The What Main Hall
Code snippet:
<table>
	<caption>Concert dates</caption>
	<tr>
		<th>Date</th>
		<th>Event</th>
		<th>Venue</th>
	</tr>
	<tr>
		<td>12 Feb</td>
		<td>Waltz with Strauss</td>
		<td>Main Hall</td>
	</tr>
	[…]
</table>

The following WCAG 2.0 technique was used in the example above