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
https://forums.phpfreaks.com/topic/119904-table-and-aligning/
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
https://forums.phpfreaks.com/topic/119904-table-and-aligning/#findComment-619162
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.