HTML <caption> Tag

Description

The <caption> HTML tag is used to provide a title or description for a table in a web page. Placed immediately after the opening <table> tag, it helps to clarify the content and purpose of the table for users and search engines. Typically displayed above or below the table, the <caption> tag is essential for improving accessibility and understanding the data presented within the table, making it a valuable tool for structuring and organizing tabular information on the web.

Properties

Permitted Parents
A <table> element, as its first descendant
Content
Inline and text
Start/End Tags
Start tag: required, End tag: required

Example

<table border="1">
<caption>Monthly savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>

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

Browser Support

The following table will show you the current browser support for the HTML <caption> tag.

Desktop
Edge Chrome Firefox Opera Safari
1211154
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
184143.214.4

Last updated by CSSPortal on: 30th September 2023