HTML <th> alignProperty

HTML <th> Tag

Example

Align the content in the header cells to the left:

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

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the align attribute.

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


Definition and Usage

HTML5 does not support the <th> align attribute. Please use CSS instead.

The align attribute specifies the horizontal alignment of content in header cells.


Syntax

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

Property value

Value Description
left Left-aligned content.
right Right-aligned content.
center Center-aligns content (the default value for <th>).
justify Stretches rows so that each row can have equal width (like in newspapers and magazines).
char Align the content to the specified character.


HTML <th> Tagother extensions