Skip to: content, navigation

by Ian Lloyd

valign (HTML attribute)

Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Partial Partial Partial Partial
Spec
Depr. Version
No HTML 4
valign=" { baseline | bottom | middle | top } "

Example

The valign is set to "bottom" for each of these td elements:

  <tr>
    <td valign="bottom">Alison</td>
    <td valign="bottom">alison@megacorp</td>
    <td valign="bottom">888652</td>
  </tr>

Description

In a very similar manner to the align attribute for this element, the valign allows you to override the default vertical alignment for content inside table cells.

Note that there is both a better way, and a much, much better way to do this. The better way is not to set the valign at the td level, as in a bigger table with more columns, you’ll end up with unnecessarily bloated markup. Instead, you could set valign at the parent tr level. However, this is still less than ideal. The preferred method would be to set the alignment of text inside the td elements using the CSS vertical-align property.

Value

The recognized attribute values are as shown in the syntax section.

Compatibility

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

In the browsers tested, "bottom", "middle", and "top" alignments are all honored, but the "baseline" value is ignored by all.

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