HTML <caption> tag
Example
A table with a caption:
<table border="1">
<caption>Monthly savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table> |
Try it yourself!
|
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.
Browser Support
The <caption> tag is supported in all major browsers.
Differences Between HTML and XHTML
The "align" attribute of the caption element was deprecated
in HTML 4.01, and is not supported in XHTML 1.0
Strict DTD.
Optional Attributes
DTD indicates in which DTD the attribute is
allowed. S=Strict, T=Transitional, and F=Frameset.
Attribute |
Value |
Description |
DTD |
align |
left
right
top
bottom |
Deprecated. Use styles instead. How to align the caption. |
TF |
Standard Attributes
id, class, title, style, dir, lang, xml:lang |
For a full description, go to Standard
Attributes.
Event Attributes
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup |
For a full description, go to Event Attributes.
Learn XML with <oXygen/> XML Editor - Free Trial!
|
|
oXygen helps you learn to define,
edit, validate and transform XML documents. Supported technologies include XML Schema,
DTD, Relax NG, XSLT, XPath, XQuery, CSS.
Understand in no time how XSLT and XQuery work by using the intuitive oXygen debugger!
Do you have any XML related questions? Get free answers from the oXygen
XML forum
and from the video
demonstrations.
Download a FREE 30-day trial today!
|
|