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!

width setting in IE and NS 3

Status
Not open for further replies.

moepower

Programmer
Oct 5, 2000
93
US
What can I do to set the column width where it is consistent between IE and Netscape. Ex.

<table width=750 cellspacing=2 cellpadding=0>
<tr>
<td width=300>text1</td>
<td width=50>text2 </td>
<td width=200>text3</td>
<td width=200>text4</td>
</tr>
</table>

Why would the table information would show properly in IE, but NS would have the first column a lot smaller than IE.

How can I fix this. Thanks,
 
Should be the same. The difference in the browsers are the margin sizes. Can we see the code in question? DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
If you MUST have columns these exact widths, the only way you can be absolutely sure it happens in all browsers is to put a tiny shim image in each <td>. Make a 1x1 pixel gif with a transparent background and nothing in it (so it's transparent, basically). Then try this:
Code:
<table width=750 cellspacing=2 cellpadding=0>
  <tr>
    <td width=300><img src=&quot;shim.gif&quot; width=300 height=1 border=0><br>text1</td>
    <td width=50><img src=&quot;shim.gif&quot; width=50 height=1 border=0><br>text2 </td>
    <td width=200><img src=&quot;shim.gif&quot; width=200 height=1 border=0><br>text3</td>
    <td width=200><img src=&quot;shim.gif&quot; width=200 height=1 border=0><br>text4</td>
  </tr>
</table>
You could also use style sheets to set some <div> tags to be the width you want, but this way is soooo much easier. Browsers will sometimes render tables the way they want, no matter what you say in the <td> attributes.

My two cents...
 
Glowball,

Thank you, thank you, thank you. I've spent days trying to get IE and NS to play nicely with each other. At least now, I've one less thing to worry about.
 
You all are so right, netscape is a big pain,
when you're making a site, there's always trouble with netscape. I usually examin my site in Netscape, but I stopped doing it.
And to pgosse: Form elements are really pissing me of, but most frustrating, still, is frames in netscape. look at this:

Code:
<fcramset cols=&quot;117, *&quot; etc.>
  <frame src=&quot;left.html&quot; scroll=no>
  <frame src=&quot;home.html&quot; scroll=yes>
</framset>

Netscape will give you less space, saving it for a scrollborder even when no scrollers are set
 
Okay, I see my two cents and raise to four... I don't see Netscape as evil at all because it really holds you to good HTML coding. People like IE because it takes anyone's half-assed code and tries to correct it -- in other words, IE will save you if you don't know what you're doing. Netscape, however, will FORCE you to write correct code. And Netscape isn't as unforgiving as WebTV and other browsers.

I think testing in Netscape is a good idea because if it works there it'll work almost anywhere and that's a good thing!

As for the frames, perhaps
Code:
scroll=auto
will give you what you're looking for?

P.S. ToddWW, Glowball=Monica *smile*
 
Oh.. Whoops..

You da girl !!

Sorry about that. :~/

ToddWW
 
Hehh, common mistake, no worries! Gotta keep you on your toes...
 
i'm with Glowball, right coding ONLY!!
but sometimes (read: allways) it is a real PITA, when you (or me) write something to be a cross-browser!!! Victor
 
I agree that right coding is a GOOD THING. That doesn't, however, mean that I like having to code around the deficiencies and problems with NS to do it. I just do my right coding for IE.

Todd: Don't be too embarrassed. When you use handles instead of names things like that are bound to happen. Even when people see my REAL name in my signature they STILL have trouble figuring out that I'm a guy. I'm so used to it after 45 years that I get a chuckle out of it now. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Hi,

here is another solution you guys may want to use
<table width=750 cellspacing=2 cellpadding=0>
<tr>
<td width=300 nowrap>text1</td>
<td width=50 nowrap>text2</td>
<td width=200 nowrap>text3</td>
<td width=200 nowrap>text4</td>
</tr>
</table>

hope this helps, Chiu Chan
WebMaster & Software Engineer
emagine solutions, inc
cchan@emagine-solutions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top