<caption align="">
Browser |
|
---|---|
Type |
The align attribute of the CAPTION element specifies the alignment of the table caption.
<caption align="left">table caption</caption>
Attribute | Value | Explanation |
---|---|---|
align=" " | top | positions the caption at the top of the table (default) |
bottom | positions the caption at the bottom of the table | |
left | positions the caption at the left of the table | |
right | positions the caption at the right of the table |
The use of this attribute is deprecated. (Use CSS instead)
Example
<table border="1">
<caption align="top">Table caption</caption>
<tr>
<td>Row1 - Col1</td>
<td>Row1 - Col2</td>
<td>Row1 - Col3</td>
</tr>
<tr>
<td>Row2 - Col1</td>
<td>Row2 - Col2</td>
<td>Row2 - Col3</td>
</tr>
</table>
- Output
-
Table caption Row1 - Col1 Row1 - Col2 Row1 - Col3 Row2 - Col1 Row2 - Col2 Row2 - Col3
<table border="1">
<caption align="bottom">Table caption</caption>
<tr>
<td>Row1 - Col1</td>
<td>Row1 - Col2</td>
<td>Row1 - Col3</td>
</tr>
<tr>
<td>Row2 - Col1</td>
<td>Row2 - Col2</td>
<td>Row2 - Col3</td>
</tr>
</table>
- Output
-
Table caption Row1 - Col1 Row1 - Col2 Row1 - Col3 Row2 - Col1 Row2 - Col2 Row2 - Col3
<table border="1">
<caption align="left">Table caption</caption>
<tr>
<td>Row1 - Col1</td>
<td>Row1 - Col2</td>
<td>Row1 - Col3</td>
</tr>
<tr>
<td>Row2 - Col1</td>
<td>Row2 - Col2</td>
<td>Row2 - Col3</td>
</tr>
</table>
- Output
-
Table caption Row1 - Col1 Row1 - Col2 Row1 - Col3 Row2 - Col1 Row2 - Col2 Row2 - Col3
<table border="1">
<caption align="right">Table caption</caption>
<tr>
<td>Row1 - Col1</td>
<td>Row1 - Col2</td>
<td>Row1 - Col3</td>
</tr>
<tr>
<td>Row2 - Col1</td>
<td>Row2 - Col2</td>
<td>Row2 - Col3</td>
</tr>
</table>
- Output
-
Table caption Row1 - Col1 Row1 - Col2 Row1 - Col3 Row2 - Col1 Row2 - Col2 Row2 - Col3