Forum Moderators: open

Message Too Old, No Replies

Vertical alignment within a table: how?

Content is vertically centered in layouting-table

         

wolfadeus

10:33 am on Jan 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I probably made a mistake using tables for layouting my site in first place, but here I am, wondering if there is an easy way to get around:

I use a table with three columns for a basic structure, the main content is in the central one and therefore, this one pushes the table to its height.

In the left and right column, there are small tables, pics, google ads and alike. Unterneath this content, I placed an invisible table with a maximum height of 100% to "push" the content to the top.

This works in IE, but not in firefox nor a couple of other browsers. How could I change that? (valign="top") doesn't help).

Please don't be mean for using tables, I'm a beginner and greatfully await your advice. Thanks!

Robin_reala

11:58 am on Jan 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



td { vertical-align: top; }

wolfadeus

8:01 pm on Jan 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My seviour and hero! Thanks a thousand times, you have no idea for how long that bothered me! :D W.

peterinwa

12:54 am on Jan 29, 2006 (gmt 0)

10+ Year Member



I'm puzzled why valign didn't work as I thought tables were pretty consistent in all browsers. My site uses it and looks fine in IE, N and FF. Makes me wonder if there might have been some minor error in your table coding.

Anyway, don't know what's to feel bad about using tables for page layout. I'm doing great with my website and didn't know there was any other way!

Peter

rocknbil

9:55 am on Jan 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



^ ^ Agreed, valign="top" should do the same thing (although the css application is preferred.) Also, wolfadeus, table/td height is basically worthless in most browsers, it will seldom actually go to a specific height and thus may not do what you want anyway.

Usually when I have a cell that's not cooperating it's a coding error (validate your code with the w3c validator,) an incorrect colspan/rowspan somewhere, or some parent object's attributes are overriding the valign="top." Your problem may still be there. :-)

peco

9:44 pm on Jan 31, 2006 (gmt 0)

10+ Year Member



It looks like there are a lot of nested tables, maybe you have put the attribute in the wrong cell.

wolfadeus

11:20 pm on Jan 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks a lot for the advice, I will check the website - but so far I am still happy that the alignment works for now!