English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
<th> align attribute usage, the align attribute specifies the horizontal alignment of the content in the title cell. Online examples demonstrate how to use the <th> align attribute, browser compatibility, syntax definition, and detailed information about its attribute values.
Align the content of the title cell to the right:
<table style="width:100%;" border="1"> <tr> <th align="right">Doll Manufacturer</th> <th align="right">Doll Type</th> </tr> <tr> <td>Barbie Princess</td> <td>6Joint Barbie Doll</td> </tr> <tr> <td>Barbie Princess</td> <td>12Joint Barbie Doll</td> </tr> </table>Test and see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the align attribute.
Note:Almost no browsers can correctly handle the "char" value.
HTML5 The <th> align attribute is not supported. Use CSS instead.
The align attribute specifies the horizontal alignment of the content within the table header cell.
<th align="left|right|center|justify|char">
Value | Description |
---|---|
left | Aligns the content to the left. |
right | Aligns the content to the right. |
center | Centers the content (the default value for <th>). |
justify | Stretches the line so that each line can have an equal width (like in newspapers and magazines). |
char | Aligns the content to the specified character. |