HTML Tag Reference - HTML tag <caption>

<caption> marks a short description to be added to a table. It may only be placed immediately after an opening <table> tag.

Browser compatibility

<caption> Yes Yes Yes Yes Yes

What's new in HTML5

The align attribute is removed from HTML5.


Possible values:left|right|top|bottom. Not supported in HTML5. Defines the alignment of the caption.

Global Attributes

The <caption> tag supports the Global Attributes in HTML.

Event Attributes

The <caption> tag supports the Event Attributes in HTML.

Default CSS Settings

caption { 
    display: table-caption;
    text-align: center;


A demo showing how to use <caption> tag.

               <caption>This is the caption for this table.</caption>
                    <td>Cell 1</td>
                    <td>Cell 2</td>
                    <td>Cell 3</td>
                    <td>Cell 4</td>
</body><!--from w ww  .  j a v  a2 s  .  co m-->

Click to view the demo