HTML slt;tr> align property
The align property in the label is used to set the horizontal alignment of text, with desirable values of left, right, center, justify, and char.
HTML tables with center-aligned rows:
<tr align="center">
<th>Month</th>
<th>Savings</th>
</tr>
<tr align="center">
<td>January</td>
<td>$100</td>
</tr>
</table>
Try it out . . .
Browser support
The align property is supported by all major browsers.
Note: Few browsers handle the "char" value correctly.
Note: IE does not handle the "justify" value correctly, and IE processes it in a centered manner.
Definitions and usages
HTML5 does not support the .lt;tr> align property. Use CSS instead.
The align property specifies the horizontal alignment of the contents in the table row.
Grammar
The property value
value | describe |
---|---|
left | 左对齐内容(<td> 元素的默认值)。 |
right | Right alignment. |
center | 居中对齐内容(<th> 元素的默认值)。 |
justify | Stretching the line so that each row can have equal width (just like in newspapers and magazines). |
char | Align the contents of the specified character. |
HTML and tr;tags