wwedude Posted August 15, 2008 Share Posted August 15, 2008 My site is a table, with a repeating background to make the column. I have two columns, and here is my problem: When there is more in one column, then the other, the one with less is aligning vertically center. Here is a example of it: http://i37.tinypic.com/2ps0pkz.png Here is the code: div#content { background-image:url(http://i33.tinypic.com/23k3p7n.png); background-repeat:repeat-y; font-family: Tahoma, Verdana, sans-serif; padding-top: 0px; margin-top: 0px; } and the html: <div id="content"><table><tr> <td style="padding-left: 50px;" width="273"> content one </td> <td style="padding-left: 102px; padding-top:0px;" width="450"> content two </td></tr></table> </div> Thanks for any help, if it is possible to avoid this Quote Link to comment https://forums.phpfreaks.com/topic/119904-table-and-aligning/ Share on other sites More sharing options...
Fadion Posted August 16, 2008 Share Posted August 16, 2008 Why use tables anyway. They are ugly, spam the markup, non semantic, slow, blah blah. Just add a valign="top" attribute to both tds. Quote Link to comment https://forums.phpfreaks.com/topic/119904-table-and-aligning/#findComment-617734 Share on other sites More sharing options...
s1yman Posted August 18, 2008 Share Posted August 18, 2008 I agree with GG, tables are outdated. DIVs are the way forward. But here's the answer to your question anyway; Add valign="middle" in the <td> tags. But the problem is that you are using two different size columns, so they are not going to appear to have the same alignment. Best thing I can advise is use div tags instead, second best thing would be to set your "height" on the cells to match. Hope this helps. Quote Link to comment https://forums.phpfreaks.com/topic/119904-table-and-aligning/#findComment-619162 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.