Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

Phantom white space below images in table cells - Firefox/Mozilla etc

Weird extra white space below images inside table cells

5:20 pm on Jun 15, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 25, 2003
votes: 0

Would anyone happen to know why i seem to be getting a white space appear underneath every image i place inside a table cell regardless of contents. This doesnt happen in IE however it does with firefox, mozilla, opera, netscape etc it doesnt happen with any of my other sites n its bugging the hell out of me.



7:14 pm on June 15, 2006 (gmt 0)

Junior Member

5+ Year Member

joined:May 11, 2006
votes: 0

im requesting the preview!

Did you make sure your closing </td> tags are on the same line as the image in your editor.

when i use VS 2003 sometimes i get phantom white space (about the height of a <BR> tag) below content in table cells. This is because VS puts a hidden line break that sometimes renders. So if your tags look like this:

<img src="image.jpg">


<td><img src="image.jpg"></td>

that MAY help (it does for me sometimes!)


7:37 pm on June 15, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 25, 2003
votes: 0

Its fine i've sorted it now, had to include the align attribute into the img tag which i dont usualy have to, strange, however all is working now thanks for the help.
8:46 pm on June 15, 2006 (gmt 0)

Full Member

10+ Year Member

joined:Nov 18, 2003
votes: 0

Using strict rendering, images sit on the text base-line by default. This means that there will be a small gap between the bottom of the image and the table cell border (and above the image if it is small enough).

You can resolve the problem, as you said, by changing the content vertical alignment. It also helps to avoid using tables for structural layout, as this exacerbates the issue.

Note that Gecko shrinks table cells to fit when rendering in Quirks mode, so this problem tends to come as a surprise to many people.