HTML tr align property
Examples
With center-aligned HTML table row:
<table width="100%" border="1">
<tr align="center">
<th>Month</th>
<th>Savings</th>
</tr>
<tr align="center">
<td>January</td>
<td>$100</td>
</tr>
</table>
<tr align="center">
<th>Month</th>
<th>Savings</th>
</tr>
<tr align="center">
<td>January</td>
<td>$100</td>
</tr>
</table>
try it"
Browser Support
All major browsers support align attribute.
Note: Almost no browser can handle "char" value correctly.
Definition and Usage
HTML5 does not support the <tr> align attribute. Use CSS instead.
Align attribute specifies the horizontal alignment of the contents of a table row.
grammar
<tr align="left|right|center|justify|char">
Property Value
值 | 描述 |
---|---|
left | 左对齐内容(<td> 元素的默认值)。 |
right | 右对齐内容。 |
center | 居中对齐内容(<th> 元素的默认值)。 |
justify | 对行进行伸展,这样每行都可以有相等的宽度(就像在报纸和杂志中)。 |
char | 将内容对准指定字符。 |
HTML <tr> tag