HTML5 <caption> Tag

Example

A table with a caption:

<table>
  <caption>Monthly savings</caption>
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>500$</td>
  </tr>
</table>
Code it Online »

Definition and Usage

The <caption> tag defines a table caption.

The <caption> tag must be inserted immediately after the <table> tag.

You can specify only one caption per table.

Usually the caption will be centered above the table.

Differences Between HTML 4.01 and HTML5

The "align" attribute which was deprecated in HTML 4.01, is not supported in HTML5. Use CSS instead.

Standard Attributes

The <caption> tag also supports the Standard Attributes in HTML5.

Event Attributes

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


Have Any Suggestion? We Are Waiting To Hear from YOU!

Your Query was successfully sent!