|
|
HTML <caption> tag
Syntax
<caption> - </caption>
Definition and Usage
The CAPTION elements provides a brief summary of the table's contents
or purpose. The <caption> tag must immediately follow the <table>
tag and precede all other tags. The width of the caption is determined by the
width of the table.the caption's position as displayed in the browser can be
controlled with the align attribute.
Optional Attributes
| Attribute |
Value |
Description |
| align |
left
right
top
bottom |
Caption's alignment. Deprecated in favor of style shhets. |
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.
Example
| Source |
Output |
<table border="2">
<caption>This is a sample caption</caption>
<tr>
<td>Content 1</td>
<td>Content 2</td>
</tr>
</table> |
This is a sample caption
| Content 1 |
Content 2 |
|
|
|