Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netscape Image Misalignment

Status
Not open for further replies.

FastJimmy

Programmer
Jun 15, 2000
23
US
So I'm having this really annoying problem with Netscape and Image Alignment. What I have done is created a table with a single table cell in it. Inside this cell is a form the contains a input type="image". The problem is that this image will not display inside it's cell when loaded in Netscape 6.1. I have align set set to right, but somehow it always ends up ouside/overlapping the cell it's supposed to be in. It works 100% in IE All Versions, but this netscape business is killing me. Any help you could give would be very much appreciated.

Jimmy

Here's my code:
(Some tags are XHTML)

<tr>
<td colspan=&quot;3&quot; align=&quot;right&quot;>
<table align=&quot;right&quot; width=&quot;170&quot; border=&quot;1&quot;>
<tr>
<td align=&quot;right&quot; width=&quot;170&quot;>
<form action=&quot;/servlet/OnlineShopping&quot; method=&quot;post&quot; name=&quot;resetbtn&quot;>
<eItemID type=&quot;hidden&quot;/>
<eCopyParameter parameter=&quot;IID&quot; newname=&quot;OVERRIDEIID&quot; type=&quot;hidden&quot;/>
<eCopyParameter parameter=&quot;PCR&quot; type=&quot;hidden&quot;/>
<input type=&quot;image&quot; src=&quot;/gifs/btn_resetextdimensions.gif&quot; align=&quot;right&quot; name=&quot;resetdimensions&quot; lowsrc=&quot;/gifs/fill.gif&quot; width=&quot;170&quot; height=&quot;14&quot; alt=&quot;Continue&quot; border=&quot;0&quot;/>
<input type=&quot;hidden&quot; name=&quot;ACTN&quot; value=&quot;50300&quot;/>
</form>
</td>
</tr>
</table>
</td>
</tr>
 
After testing I've found this works in Netscape 4.6 just fine.

Jimmy
 
I don't have NN6 on my machine, but I see that you end the last 2 input-tags with &quot;/>&quot;
It should be &quot;>&quot; I think

I think you copied that from your XHTML tags?

IE is much more forgiving then NN, so it don't surprise me if IE will just read it as you wish you had code it and NN won't.

Maybe it helps you,
Erik
 
Good suggestion but our XML parser (and all I believe) requires all tags without a specified closing tag to have a '/' at the end. This indicates the the tag is standalone.

Also, since I made this post I've noticed that if I drag my mouse over the overlapping image (as if to highlight it) the image moves to it's correct placing. This is really weird.

Jimmy
 
I've found that Netscape treats the whitespace it's supposed to ignore as spaces or breaks sometimes, so that's probably it. It will also sometimes handle <form> tags as formatting tags. Try something like this:
Code:
<form action=&quot;/servlet/OnlineShopping&quot; method=&quot;post&quot; name=&quot;resetbtn&quot;>
<eItemID type=&quot;hidden&quot;/>
<eCopyParameter parameter=&quot;IID&quot; newname=&quot;OVERRIDEIID&quot; type=&quot;hidden&quot;/>
<eCopyParameter parameter=&quot;PCR&quot; type=&quot;hidden&quot;/>
<tr>
<td colspan=&quot;3&quot; align=&quot;right&quot;><table align=&quot;right&quot; width=&quot;170&quot; border=&quot;1&quot;>
<tr>
<td align=&quot;right&quot; width=&quot;170&quot;><input type=&quot;image&quot; src=&quot;/gifs/btn_resetextdimensions.gif&quot; align=&quot;right&quot; name=&quot;resetdimensions&quot; lowsrc=&quot;/gifs/fill.gif&quot; width=&quot;170&quot; height=&quot;14&quot; alt=&quot;Continue&quot; border=&quot;0&quot;/><input type=&quot;hidden&quot; name=&quot;ACTN&quot; value=&quot;50300&quot;/></td>
</tr>
</table></td>
</tr>
</form>
This may screw up your XHTML, and technically having something between the </tr> and another <tr> isn't valid, but it works. The trick is to make sure that everything between where any and all <td> tags open and close have no whitespace or carriage returns. If you need returns for code readability you can always break in mid-tag. Hope that sheds some light!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top