Valign = "top" does not work in td

My problem is published as “resolved” here, but apparently I do not understand the solution (?). I have piles of outdated html that seems to be starting to fail in my browser, I don’t know why, perhaps because of the “unsupported” attributes? (I’m exceptionally disappointing, by the way. Why eliminate these much simpler attributes that have worked fine for decades? I don’t give a riff to anyone to think about my coding style if it WORKS.)

In particular, I use and the option does not work. So I tried the following, never succeeding:

<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 just upset. Any suggestions?

+8
html css html-table valign
source share
3 answers

vertical-align:top not assumed in the td tag. You must put it in the style="" 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 need to specify a separate class or identifier for each td so that their styles differ.

+10
source share

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 can do it

 <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;"> 
+1
source share

vertical-align:top use valign="top" .

Here is your code:

 <td align="center" valign="top"> 

Note: Never use : in HTML attributes, so instead of using valign:top you should use valign="top"

0
source share

All Articles