Description:

The <caption> tag is used for creating table captions.

Example Code:
<table border="1">
  <caption>Monthly savings</caption>
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
</table>
Result:
Monthly savings
Month Savings
January $100
Attributes:
Attribute Definition
align

Specifies the alignment of the caption.
Possible Values:

  • left
  • right
  • top
  • bottom
Global Attributes:

The <caption> tag also supports the Global Attributes in HTML5

Event Attributes:

The <caption> tag also supports the Event Attributes in HTML5