HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
A table with a caption
The <caption>
tag defines a table caption.
The <caption>
tag must be inserted immediately after the
<table> tag.
Element | |||||
---|---|---|---|---|---|
<caption> | Yes | Yes | Yes | Yes | Yes |
The <caption>
tag also supports the Global Attributes in HTML.
The <caption>
tag also supports the Event Attributes in HTML.
Position table captions (with CSS):
<table>
<caption style="text-align:right">My savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<br>
<table>
<caption
style="caption-side:bottom">My savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
HTML DOM reference: Caption Object
Most browsers will display the <caption>
element with the following default values:
caption {
display: table-caption;
text-align: center;
}