Description:

The <caption> tag is used for creating table captions. The display position of the title for the table is specified by the align attribute. If align = "top" is specified, align = "bottom" at the top of the table will be centered at the bottom of the table. If nothing is specified with the align attribute, it is centered at the top of the table and displayed.

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



Last updated on 2 August 2018 By Rene Spronk

View All HTML Tags

Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.