HTML caption

From Htmlpedia
Jump to: navigation, search

Caption

Definition and Usage

The element caption is used to add a headline to a table und must be placed after the element table. It is displayed on top of the table and will be read by screen readers before the content of the table. Can be formatted with CSS.

Example

<table border="1">
  <caption>Highest Mountains</caption>
  <tr>
    <th>South America</th>
    <th>North America</th>
    <th>Europe</th>
  </tr>
  <tr>
    <td>Aconcagua</td>
    <td>Mt. McKinley</td>
    <td>Mont Blanc</td>
  </tr>
</table>

Unformatted it will look like this:

Highest Mountains
South America North America Europe
Aconcagua Mt. McKinley Mont Blanc



Marctrix 19:58, 14 April 2007 (CEST)