HTML th align property
Examples
Left-aligned header cell contents:
<table width="100%" border="1">
<tr>
<th align="left">Month</th>
<th align="left">Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<tr>
<th align="left">Month</th>
<th align="left">Savings</th>
</tr>
<tr>
<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 <th> align attribute. Use CSS instead.
align attribute specifies the header cell content in horizontal alignment.
grammar
<th align="left|right|center|justify|char">
Property Value
值 | 描述 |
---|---|
left | 左对齐内容。 |
right | 右对齐内容。 |
center | 居中对齐内容(<th> 的默认值)。 |
justify | 对行进行伸展,这样每行都可以有相等的宽度(就像在报纸和杂志中)。 |
char | 将内容对准指定字符。 |
HTML <th> tag