Monthly savings Month Savings"> Monthly savings Month Savings" />
Easy Tutorial
❮ Av Prop Startdate Att Frame Marginheight ❯

HTML <caption> Tag

Example

A table with a caption:

<table border="1">
  <caption>Monthly savings</caption>
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
</table>

Browser Support

All major browsers support the <caption> tag.


Tag Definition and Usage

The <caption> tag defines the title of a table.

The <caption> tag must be inserted immediately after the <table> tag.

You can only define one caption per table.

Tip: By default, this caption will be centered above the table. However, CSS properties "text-align" and "caption-side" can be used to set the alignment and display position of the caption.


Differences Between HTML 4.01 and HTML5

HTML5 does not support the align attribute.

The align attribute in HTML 4.01 is deprecated.


Attributes

Attribute Value Description
align left <br>right <br>top <br>bottom HTML5 does not support. HTML 4.01 deprecated. Defines the alignment of the caption.

Global Attributes

The <caption> tag supports HTML's global attributes.


Event Attributes

The <caption> tag supports HTML's event attributes.

❮ Av Prop Startdate Att Frame Marginheight ❯