The HTML container element
<caption> ... </caption>is used within the <table> element to provide a table caption.
The contained text is used as a table caption and is centred relative to the table centre.
The tag has a single attribute align which can take the values top or bottom controlling whether the caption appears at the top or bottom of the table. The default value is top.
Here's an example
Province | Capital |
---|---|
British Columbia | Victoria |
Alberta | Edmonton |
Saskatchewan | Regina |
Manitoba | Winnipeg |
<table border=5> <caption align=bottom>Some Canadian Provinces</caption> <tr><th width=50%>Province<th width=50%>Capital <tr><td>British Columbia<td>Victoria <tr><td>Alberta<td>Edmonton <tr><td>Saskatchewan<td>Regina <tr><td>Manitoba<td>Winnipeg </table>
See also <table>, <td>, <tr>, <th> and the general notes on tables.