Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

valign=“top” not working in td

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?

like image 448
Alan K Hunt Avatar asked Aug 05 '13 03:08

Alan K Hunt


2 Answers

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.

like image 129
s0d4pop Avatar answered Oct 21 '22 02:10

s0d4pop


You can use valign= top not valign: top or vertical-align: top in your html markup and use vertical-align: top; in css

In your html you could do this

<td align=center valign=top>

In your css stylesheet

td{vertical-align: top;}

And in your inline-style

<td align=center style="vertical-align: top;">
like image 37
Bhojendra Rauniyar Avatar answered Oct 21 '22 01:10

Bhojendra Rauniyar