HTML <caption> tag
Examples
Table with headings:
<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"
Browser Support
All major browsers support <caption> tag.
Tag definitions and instructions
<Caption> tag defines a table header.
<Caption> tag must be placed directly after the <table> tag.
You can define a caption for each table.
Note: This title is usually centered on top form.However, CSS attribute "text-align" and "caption-side" can be used to set the title display position and alignment.
Differences between HTML 4.01 and HTML5
HTML5 does not support align attribute.
Attributes
属性 | 值 | 描述 |
---|---|---|
align | left right top bottom |
HTML5 不支持。HTML 4.01 已废弃。 定义标题的对齐方式。 |
Global Properties
<caption> tag supports HTML global properties .
Event Properties
<caption> tag supports HTML event properties .