td padding only working right in IE

windows

Guest
On one of my sites (<!-- m --><a class="postlink" href="http://fourinarow.50webs.com">http://fourinarow.50webs.com</a><!-- m -->), I'm trying to duplicate cellpadding="0" with css.

td {
background-color : #4682b4;
border-width : 1px;
border-style : inset;
padding : 0;
}

However, only in IE does this work as I want. Opera and Netscape distort what is meant to be grid of squares, by adding padding below the images in the cells. There must be a simple fix for this?I aren't completely sure, but don't you need the units of the padding for it to work? ie. 0px rather than just 0?I've changed it to 0px; no change. Any other ideas?Try adding this to your CSS so that the img's inside of td's are treated as block-level elements:

td img {
display: block;
margin: 0;
padding: 0;
}

PS: when a dimension is zero (0), that's the only time you don't need a unit.Ah, that's done it, thanks. :)
 
Back
Top