Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML table align attribute

HTML

HTML table Tag Reference HTML

The align attribute
tag

Example

A right-aligned HTML table:

Month Savings
January $100
February $80

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the align attribute.


Definition and Usage

HTML5 does not support

In HTML 4.01,

the align attribute. Please use CSS instead.

The align attribute specifies the alignment of the table relative to the surrounding text.

Typically, line breaks appear before and after an HTML table. By using the align attribute, you can achieve the effect of other HTML elements surrounding the table.


Compatibility notes

In HTML 4.01,

The align attribute is deprecated.

CSS syntax:

The align attribute is deprecated; use CSS instead.

CSS example: Table alignment

In our CSS tutorial, you can find more details about The float attribute details.


Syntax

Attribute values

Value Description
left Left-align the table.
right Right-align the table.
center Center-align the table.

HTML table Tag Reference HTML

tag