Forum Moderators: open

Message Too Old, No Replies

Gap Under Images in Tables in IE

Problem and Solution

         

Horse Feathers

12:33 am on Jan 18, 2005 (gmt 0)

10+ Year Member



I can pin images in place with a table, and everything will look like I want it to in Mozilla, Firefox, and Opera. However, Internet Explorer keeps shoving a little 1-2 pixel space underneath my image:

<table>
<tr>
<td width=X>
<img src="image.ext" width=X>
</td>
</tr>
</table>

The individual cell ended up being the height of the image + 1. I'd been smacking my head on my keyboard for a while about this, so I finally just played with different tags until I got it to work. Just one thing is missing:

 <img src="image.ext" width=X align="left">

After that, the cells held the image perfectly, and my tables aligned in IE as well as the other browsers.


I tried looking around here for the answer when I first had the problem, but couldn't find anything that worked. I've had to use hippie's [webmasterworld.com] workaround in the past, but that just wasn't going to work in this case, so I wanted to make sure that this solution might also be searchable should someone else have the same issue.

BlobFisk

9:34 am on Jan 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried putting:

<td width=X>
<img src="image.ext" width=X>
</td>

On one line, like this:

<td width=X><img src="image.ext" width=X></td>

I've seen this before and the all on one line can fix it.

One thing about your workaround is that the [blue]align[blue] property is deprecated and will not validate...

HTH