Web4College

HTML caption tag

<caption> tag defines the title or detail of the table. This tag participates in making the model of table. It also provides the table number and the context of the table.

Example
Try it
<table class="demoTable">
 <caption>Multiplication table</caption>
 <tr> <th></th> <th>1</th> <th>2</th> <th>3</th> </tr>
 <tr> <td>1</td> <td>1</td> <td>2</td> <td>3</td> </tr>
 <tr> <td>2</td> <td>2</td> <td>4</td> <td>6</td> </tr>
 <tr> <td>3</td> <td>3</td> <td>6</td> <td>9</td> </tr> 
</table>
Multiplication table
123
1123
2246
3369

Tag Uses

Specific uses of <caption> tag

It defines a title or context of the table.

Tag omission

Both opening and closing tags are necessary for the caption element.

Global Attributes

All the global attributes are applicable on the caption element.