English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag大全

HTML: <th> align attribute

<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.

 HTML <th> tag

Online Example

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 ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the align attribute.

Note:Almost no browsers can correctly handle the "char" value.

Definition and Usage

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.

Syntax

<th align="left|right|center|justify|char">

Attribute Value

ValueDescription
leftAligns the content to the left.
rightAligns the content to the right.
centerCenters the content (the default value for <th>).
justifyStretches the line so that each line can have an equal width (like in newspapers and magazines).
charAligns the content to the specified character.
 HTML <th> tag