<caption align="">

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O
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

top

<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
bottom

<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
left

<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
right

<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