tables and images, in IE (ok in firefox)

J

jodleren

hi all!

I have this

<table cellpadding=0 cellspacing=0 border=0>
<tr><td valign="top">
<img src="img1.gif" border=0>
</td><td valign="top">
&nbsp;a
</td></tr>
<tr><td valign="top">
<img src="img2.gif" border=0><img src="img3.gif" border=0>
</td><td valign="top">
&nbsp;b
</td></tr></table>

Problem: IE gives a small pixel distance between the rows. Firefox
does not.
I have another file, which works in IE. But I cannot tell the
difference, except it consists of 3 td's, and their width's are set.

What is the secret?
 
R

richard

hi all!

I have this

<table cellpadding=0 cellspacing=0 border=0>
<tr><td valign="top">
<img src="img1.gif" border=0>
</td><td valign="top">
&nbsp;a
</td></tr>
<tr><td valign="top">
<img src="img2.gif" border=0><img src="img3.gif" border=0>
</td><td valign="top">
&nbsp;b
</td></tr></table>

Problem: IE gives a small pixel distance between the rows. Firefox
does not.
I have another file, which works in IE. But I cannot tell the
difference, except it consists of 3 td's, and their width's are set.

What is the secret?

In css, use margin:0
I believe IE uses a default of 1.
you should also use quotes around numbers.
cellpadding="0".
without quotes it may be overlooked as being faulty.

Then why are you placing images inside a table anyway? They should be in a
division which would make coding simpler.

<div class="image1">image1.gif</div>
use css to define the peramiters.
 
J

Jonathan N. Little

richard said:
In css, use margin:0
I believe IE uses a default of 1.

Applied to what? Images, no. Images are inline by default so margins are
no applicable. I would think the problem would be more likely to happen
in Firefox not IE because improperly does not incorporate glyph ascender
and descender dimensions when determining line-height so since images
are inline Firefox added this space and hence the space above and below
images. You can add "display: block" on your images but you will have to
deal with the two images side-by-side.

We really do not have enough info to help, need the actually URL to the
page.
you should also use quotes around numbers.
cellpadding="0".
without quotes it may be overlooked as being faulty.

We again depends. Need URL to see. If HTML attribute values without
embedded spaces do no need to be quoted, but it is good practice to do so.
Then why are you placing images inside a table anyway? They should be in a
division which would make coding simpler.

<div class="image1">image1.gif</div>
use css to define the peramiters.

Agree. Most likely OP knows no other way.
 
D

dorayme

richard said:
Then why are you placing images inside a table anyway? They should be in a
division which would make coding simpler.

You mean no matter what the op's reason for having an image in a
table?
 
J

jodleren

hi all!

I have this

<table cellpadding=0 cellspacing=0 border=0>
<tr><td valign="top">
<img src="img1.gif" border=0>
</td><td valign="top">
&nbsp;a
</td></tr>
<tr><td valign="top">
<img src="img2.gif" border=0><img src="img3.gif" border=0>
</td><td valign="top">
&nbsp;b
</td></tr></table>

Problem: IE gives a small pixel distance between the rows. Firefox
does not.
I have another file, which works in IE. But I cannot tell the
difference, except it consists of 3 td's, and their width's are set.

What is the secret?

I found that <p> was missing, this works (illustration): <tr><td
valign="top"> <P> <img src="img1.gif" border=0> </P> </td><td
valign="top">

as for DIV or CSS, I dont know much about it. For testing the code
here, one could simply create some graphic files, say 20x20 pixels in
3 different colours, and one can see the "problem".

WBR
Sonnich
 
J

Jonathan N. Little

jodleren said:
I found that <p> was missing, this works (illustration): <tr><td
valign="top"> <P> <img src="img1.gif" border=0> </P> </td><td
valign="top">

Not sure how that is going to help you.
as for DIV or CSS, I dont know much about it. For testing the code
here, one could simply create some graphic files, say 20x20 pixels in
3 different colours, and one can see the "problem".

You do realize you are going to get a gap if the user enlarges the font
and the text cell expand the row taller than your graphic?
 
B

Bone Ur

Well bust mah britches and call me cheeky, on Thu, 22 Nov 2007 13:54:55 GMT
jodleren scribed:
< snip >
as for DIV or CSS, I dont know much about it. For testing the code
here, one could simply create some graphic files, say 20x20 pixels in
3 different colours, and one can see the "problem".

Sure. Send me a check for $450.00. As soon as that arrives, I'll get
right on it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top