Caption Tag in HTML


The <caption> tag is an HTML element that is used to add a title or a brief explanation to a table. It is a child element of the <table> tag and must be placed immediately after the opening <table> tag.

The content of the <caption> tag is typically displayed at the top of the table and can be styled using CSS. The caption is usually used to provide a summary or a description of the data presented in the table, which can be helpful for users who are visually impaired and use screen readers to navigate the content.

Also Read:  pre Tag in HTML

Here’s an example of how to use the <caption> tag in HTML:

<caption>Employee Information</caption>
<td>John Smith</td>
<td>Jane Doe</td>

In the example above, the <caption> tag is used to provide a title for the table, “Employee Information”. The <thead> and <tbody> tags are used to define the header and body of the table, respectively, and the <th> and <td> tags are used to define the cells of the table.


Leave a Reply