Jump to content

Table And Aligning


wwedude

Recommended Posts

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 :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.