<caption>...</caption>

HTML4 HTML5

Table title/caption is placed between the opening <caption> and closing </caption> tags.

Both opening and closing tags are required.

Attributes:

align="..." - (left, right, top, bottom) Defines caption text alignment. Deprecated in HTML4. Removed in HTML5. Use CSS style sheets for alignment instead.

Example

Code:

<table>
  <caption>Car fuel consumption</caption>
  <tr>
    <th>Fueled [l]</th>
    <th>Driven [km]</th>
  </tr>
  <tr>
    <td>42.4</td>
    <td>815</td>
  </tr>
  <tr>
    <td>40.7</td>
    <td>786</td>
  </tr>
</table>

The browser will interpret this code as follows:

Car fuel consumption
Fueled [l]Driven [km]
42.4 815
40.7 786