table alignment


<table align="">

Browser
Internet Explorer Firefox Opera
Type
Block-level Deprecated

The align attribute of the TABLE element specifies the alignment of the table.


<table align="left">


Attribute Value Explanation
align=" " left the table floats to the left
(the text wraps to the right of the table)
right the table floats to the right
(the text wraps to the left of the table)
center centers the table

The use of this attribute is deprecated. (Use CSS instead)

Please see the "stopping text wrapping" when you specified the left or right.

Tips and Notes

Use CSS instead of deprecated HTML. Please see the "Related Document" for details on CSS.


Example

Aligns to the left

<table border="1" align="left">
<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>
<tr>
<td>Row3 - Col1</td>
<td>Row3 - Col2</td>
<td>Row3 - Col3</td>
</tr>
</table>

The table floats to the left.
<br>
And the text wraps to the right of the table.
<br clear="left">
Clears the left
Output
Row1 - Col1 Row1 - Col2 Row1 - Col3
Row2 - Col1 Row2 - Col2 Row2 - Col3
Row3 - Col1 Row3 - Col2 Row3 - Col3
The table floats to the left.
And the text wraps to the right of the table.
Clears the left

Aligns to the right

<table border="1" align="right">
<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>
<tr>
<td>Row3 - Col1</td>
<td>Row3 - Col2</td>
<td>Row3 - Col3</td>
</tr>
</table>

The table floats to the right.
<br>
And the text wraps to the left of the table.
<br clear="right">
Clears the right
Output
Row1 - Col1 Row1 - Col2 Row1 - Col3
Row2 - Col1 Row2 - Col2 Row2 - Col3
Row3 - Col1 Row3 - Col2 Row3 - Col3
The table floats to the right.
And the text wraps to the left of the table.
Clears the right

Aligns to the center

<table border="1" align="center">
<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>
<tr>
<td>Row3 - Col1</td>
<td>Row3 - Col2</td>
<td>Row3 - Col3</td>
</tr>
</table>
Output
Row1 - Col1 Row1 - Col2 Row1 - Col3
Row2 - Col1 Row2 - Col2 Row2 - Col3
Row3 - Col1 Row3 - Col2 Row3 - Col3