X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML <table> align Attribute

HTML table Reference HTML <table> tag

Example

A right-aligned HTML table:

<table align="right">
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>

Try it Yourself »

Definition and Usage

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

Normally, an HTML table will have a break before and after it. The align attribute allows other HTML elements to wrap around the table.


Browser Support

Attribute
align Yes Yes Yes Yes Yes


Compatibility Notes

The align attribute of <table> is not supported in HTML5. Use CSS instead.

CSS syntax: <table style="float:right">

CSS Example: table alignment

In our CSS tutorial you can find more details about the float property.


Syntax

<table align="left|right|center">

Attribute Values

Value Description
left Left-aligns the table
right Right-aligns the table
center Center-aligns the table


HTML table Reference HTML <table> tag

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook