HTML <caption>Tag


Examples

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>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the <caption> tag.


Tag Definition and Usage Instructions

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

The <caption> tag must be placed directly after the <table> tag.

You can only define one caption for each table.

Tip:Usually, this caption is centered above the table. However, the 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.

HTML 4.01 Deprecatedalign attribute.


Attributes

Attribute Value Description
align left
right
top
bottom
Not supported in HTML5. Deprecated in HTML 4.01.Defines the alignment of the caption.


Global Attributes

The <caption> tag supportsthe HTML Global Attributes。


Event Attributes

The <caption> tag supportsthe HTML Event Attributes。

Other Extensions