valign=“top” not working in td

Alan K Hunt picture Alan K Hunt · Aug 5, 2013 · Viewed 51.5k times · Source

My problem is posted as "solved" here, but apparently I don't understand the solution (?). I have piles of legacy html that appears to be starting to fail in my browser, I dunno why, maybe because of "unsupported" attributes? (Extremely frustrating, by the way. Why eliminate these much simpler attributes that worked fine for decades? I don't give a frickin' rip what anyone thinks of my coding style, as long as it WORKS.)

In particular, I use and the valign doesn't work. So I tried the following, with never a success:

<td align=center vertical-align:top>
<td text-align:center; vertical-align:top>
<td text-align:center; vertical-align:text-top>
<td vertical-align:text-top>

Now I'm only more frustrated. Any suggestions?

Answer

s0d4pop picture s0d4pop · Aug 5, 2013

The vertical-align:top is not supposed to occur in the td tag itself. You have to put it in a style="" line or in the CSS rules for td.

Using style="":

<td align="center" style="vertical-align:top">
<td style="text-align:center; vertical-align:top">
<td style="text-align:center; vertical-align:text-top">
<td style="vertical-align:text-top">

For the CSS method, you will have to give a seperate class or id to each td in order for their styles to be different.