Forum Moderators: not2easy

Message Too Old, No Replies

Space problems with nested tables in CSS

         

Rightz

5:45 pm on Sep 14, 2007 (gmt 0)

10+ Year Member



I'm converting my tables to css basically to pass the strict doctype.

The only problem I've found is there is space between the nested tables in the css.

How can I get rid of this space?

Also how can I get the whole of .tdbotmenu to align to the bottom so the white space of .tdmenutop is actually the height I've stated?

Thanks

table#logo { background-color:white;
border-width: 0px;
border-spacing:none;
border-collapse: collapse;
width: 800px;
height:78;
padding:0px;

}

.tdlogo { background-color:white;
border-width: 0px;
border-style: none;
width: 286px;
padding:0px;
}

table#menu { background-color:white;
border-width: 0px;
border-spacing:none;
border-collapse: collapse;
width: 514px;
height:78;
padding:0px;

}

.tdmenutop {background-color:white;
border-width: 0px;
border-style: none;
width: 100%;
padding:0px;
height:37;
}

.tdbotmenu {background-color:#990000;
border-width: 0px;
border-style: none;
width: 100%;
padding:0px;
height:41;
text-align: center;
}

.tdrcorner {etc
}

<table id="logo"><tr><td class="tdlogo"><img src=logo.png alt="Discount Codes Online"></td>

<td><table id="menu"><tr><td class="tdmenutop">&nbsp;</td><td bgcolor="white"></td></tr>
<tr><td class="tdbotmenu"><h1>Free Trials ¦ Freebies ¦ Competitions ¦ Discount Codes ¦ Links ¦ FAQ</h1></td><td class="tdrcorner"><img src=rcorner.png alt="" border=0></td></tr></table>

</td>

</tr>
</table>

Rightz

5:57 pm on Sep 14, 2007 (gmt 0)

10+ Year Member



Ok I've sorted the align issue by just putting 2 br's in .tdmenutop

But a pixel is still being put around the nest table by the looks of it.

Marshall

4:09 am on Sep 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You may just want to put

border: none;

Marshall

Rightz

4:36 pm on Sep 15, 2007 (gmt 0)

10+ Year Member



nope with border:none; there is still a white border around the nested table.

Anyone else?

Marshall

4:57 pm on Sep 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Are you positive it is a border problem and not a margin or padding problem? I will test your page, but in the mean time, try adding margin:0; to the nested table and padding: 0; to the <td> it is in.

Marshall