HTML table align property
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"
Browser Support
All major browsers support align attribute.
Definition and Usage
HTML5 does not support the <table> align attribute. Use CSS instead.
In HTML 4.01, <table> The align attribute is deprecated .
align attribute specifies the table with respect to the alignment of the surrounding text.
In general, HTML table will appear before and after the wrap. By using the align attribute can achieve the effect of other HTML elements around the table.
Compatibility Notes
In HTML 4.01, <table> The align attribute is deprecated, use CSS instead.
CSS syntax: <table style = "float: right">
In our CSS tutorial you can find more information about the float property detail.
grammar
<table align="left|right|center">
Property Value
值 | 描述 |
---|---|
left | 左对齐表格。 |
right | 右对齐表格。 |
center | 居中对齐表格。 |
HTML <table> tag