Skip to: content, navigation

by Ian Lloyd

align (HTML attribute)

Spec
Depr. Version
Yes HTML 3.2
Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Partial Full Partial Partial
align=" { bottom | left | right | top } "

Example

The align for this caption is set to "right":

<table>
  <caption align="right">Interest Rates</caption>
  <tr>
    <th>Account Type</th>
    <th>Interest Rate</th>
  </tr>
  <tr>
    <td>Smart</td>
    <td>From 2%</td>
  </tr>
  <tr>
    <td>Young Saver</td>
    <td>From 1.6%</td>
  </tr>
</table>

Description

The align attribute should, in theory, align the caption as a block element to the left or right of, or above or below, the table, in the same way in which this attribute would work when applied to a table or an image. However, browser support for the attribute is poor, and it’s inconsistently interpreted and presented.

Value

Possible values for this attribute include "bottom", "left", "right", and "top".

Compatibility

IE5.5Partial
6.0Partial
7.0Partial
Firefox1.0Full
1.5Full
2.0Full
Safari1.3Partial
2.0Partial
3.0Partial
Opera9.2Partial
9.5Partial

This attribute is now deprecated, and is highly presentational in its nature. The desired visual effects can all be achieved with CSS and, as such, this attribute shouldn’t be used—it’s presented here for informational purposes only.

Browser support for this attribute is mixed. Firefox honors all the alignment settings, while Safari honors only the "bottom" attribute value, ignoring "left" and "right". Opera doesn’t align the caption left or right as a block-level element, but does align the text contained inside the caption left or right, as does Internet Explorer. In short, don’t count on being able to style a table caption.

User-contributed notes

There are no comments yet.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters