HTML <caption>
query_builder | Christopher Pisani
The element <caption> is the title of the table element. Although the text is set by default in the centre, with CSS it can be modified to your liking.
<table border=1>
<caption>He-Man and Skeletor facts</caption>
<tr>
<td> </td>
<th scope="col" class="heman">He-Man</th>
<th scope="col" class="skeletor">Skeletor</th>
</tr>
<tr>
<th scope="row">Role</th>
<td>Hero</td>
<td>Villain</td>
</tr>
<tr>
<th scope="row">Weapon</th>
<td>Power Sword</td>
<td>Havoc Staff</td>
</tr>
<tr>
<th scope="row">Dark secret</th>
<td>Expert florist</td>
<td>Cries at romcoms</td>
</tr>
</table>
Available Attributes
No specific attributes are assigned for this element, other than the standard global attributes.