Cell Height Increase in Netscape

E

e_x

Hi! I wonder if anyone can help me.

I have a problem with browser conmpatibility. My page looks fine in Opera
and IE, but in Netscape and Firefox, there is a similar problem.

I've inserted 2 pictures in 2 adjacent rows with a specified cell height.
These cell heights are equal to the picture sizes respectively.

However, in Netscape and Firefox, a gap appears between the 2 pictures. It
looks like a space is formed just above each picture.

I know that almost everyone uses IE, but I like my site to be browser
friendly.

Is there a way to force the size of a cell?

Any suggeestions will be appreciated.

Thanks.
 
E

e_x

thanks for replying.

I've found the solution.

by default, FP03 uses <p align="center"> to center align. Doesn't work to
will with NS and FF. So I've changed it to <center></center>.

Looks ok now! seems alright in IE 6. hope it'll be compatible with the lower
versions of IE..
 
R

Ronx

You can force the *minimum* size of a cell by inserting images anywhere in
the same row (sets minimum height) or same column (sets minimum width) as
the cell. But this is a minimum, you cannot fix the maximum size. There
are circumstances where the dimensions given to a cell can be altered by the
browser, if the cell contents permits it. Images prevent shrinkage, but do
not prevent growth.

How are you coding the cell and contents?
<td><img src="image.gif" width="50" height="28"></td>
should appear in the same in all browsers, provided nowhere else in the row
and column change the cell height/width.
But
<td>
<img src="image.gif" width="50" height="28">
</td>
might cause whitespace to appear above or below (or both) the image in some
browsers.
Will need to see the page or code to give a more definitive response.
 
M

Murray

While this may have solved your current problem (most likely the gap you are
seeing is the inherent margin of the <p> tag - in this case, it's FF and NN
that are showing things properly and IE that is a little twisted), it would
not be a good general solution for such things.

1. An image should never have <p> tags around it in the first place.
2. The <center> tag is deprecated.
3. If you want a table cell's contents center aligned, just make the align
attribute of the <td> tag be "center".
 
E

e_x

I don't know if my solution was a good one but this is what I did.

Previously, it was: -
<tr>
<td height="31" colspan="5">
<p align="center">
<img border="0" src="image.gif" width="200" height="31"></td>
</tr>

This coding created a space above the image when viewed in NS.

So, I rectified by:-

<tr>
<td height="31" colspan="5">
<center>
<img border="0" src="image.gif" width="200" height="31"></center></td>
</tr>

Most probably the <p> created the space. Is this a good solution? Seemed to
have fixed the problem.
 
R

Ronx

That will work, but I would simplify it with:
<tr>
<td colspan="5" align="center"><img border="0" src="image.gif" width="200"
height="31"></td>
</tr>
 
E

e_x

I see. Thanks!


Ronx said:
That will work, but I would simplify it with:
<tr>
<td colspan="5" align="center"><img border="0" src="image.gif" width="200"
height="31"></td>
</tr>
 
M

Murray

Yep - that's the ticket!

--
Murray

Ronx said:
That will work, but I would simplify it with:
<tr>
<td colspan="5" align="center"><img border="0" src="image.gif"
width="200" height="31"></td>
</tr>
 

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

Top