HTML <table> alignAttribute
Examples
A right-aligned HTML table:
<table border="1"
align="right">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
Try it Yourself »
Browser support
![]()
![]()
![]()
![]()
![]()
All major browsers support the align attribute.
Definition and usage
HTML5 does not support the <table> align attribute. Use CSS instead.
In HTML 4.01, the align attribute of <table>is deprecated。
The align attribute specifies the alignment of a table relative to the surrounding text.
Normally, line breaks appear before and after an HTML table. By using the align attribute, you can have other HTML elements wrap around the table.
Compatibility notes
In HTML 4.01, the align attribute of <table> is deprecated. Use CSS instead.
CSS syntax: <table style="float:right">
In our CSS tutorial, you can find more details about thefloat propertydetails.
Syntax
<table align="left|right|center">
Attribute values
| Value | Description |
|---|---|
| left | Left-aligns the table. |
| right | Right-aligns the table. |
| center | Center-aligns the table. |
HTML <table> tag Other extensions