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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tables in Netscape 2

Status
Not open for further replies.

calista

Programmer
Jan 24, 2001
545
US
I've discovered that I can't assign a percentage in the width attribute for a table in NS (but you can in IE). Given that I have to define the width in px, what do you do about the fact that different users have different screen resolutions? The table may take up only half the screen or be too big to fit, depending on the users' settings. So, how do I deal with that without using percentages?

Thanks! Calista :-X
Jedi Knight,
Champion of the Force
 
What does it mean "I've discovered that I can't assign"?
Everything works good if done correctly, including width percentage.
 
Sorry, I should have clarified. I'm trying to get this to work using style sheets. Today, it appears to work, but last week it didn't, and I didn't change anything. Calista :-X
Jedi Knight,
Champion of the Force
 
OK, Here's an example of what does NOT work.

TABLE.Toolbar {
background-color : #1E90FF;
width: 100%;
}

I've also tried making it just .Toolbar and I've tried hardcoding width=100% in the page itself.

I've tried using it like this:

<TABLE CLASS=&quot;Toolbar&quot;>
<TR>
<TD><SPAN CLASS=&quot;BigBlack&quot;>Service Name</SPAN></TD>
<TD><SPAN CLASS=&quot;BigBlack&quot;>Document Created</SPAN></TD>
<TD><SPAN CLASS=&quot;BigBlack&quot;>Document Last Modified</SPAN></TD>
</TR>
</TABLE>

And like this:
<TABLE BGCOLOR=&quot;#0000FF&quot; WIDTH=&quot;100%&quot;>
<TR>
<TD><SPAN CLASS=&quot;BigBlack&quot;>Service Name</SPAN></TD>
<TD><SPAN CLASS=&quot;BigBlack&quot;>Document Created</SPAN></TD>
<TD><SPAN CLASS=&quot;BigBlack&quot;>Document Last Modified</SPAN></TD>
</TR>
</TABLE>

Nothing gives me a table with a width of 100%. I don't want to hard code the width, because I don't know what screen size the user will have. Calista :-X
Jedi Knight,
Champion of the Force
 
Hi mate,

Try this,

<TABLE BGCOLOR=&quot;#0000FF&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot; border=&quot;0&quot;>
<TR>
<TD CLASS=&quot;bigblack&quot;>Service Name</TD>
<TD CLASS=&quot;bigblack&quot;>Document Created</TD>
<TD CLASS=&quot;bigblack&quot;>Document Last Modified</TD>
</TR>
</TABLE>

Hope this helps Wullie

 
Thanks, Wullie, but I'm afraid it's no go. This is NN 6.2, BTW. I dislike Microsoft as much as anyone, and would rather not use it, but NN sure doesn't make it easy.

P.S. I took a quick look at your sites. Nicely done! Calista :-X
Jedi Knight,
Champion of the Force
 
OK, now I see what happens.

width: 100%; applied to style class doesn't work in Netscape 4.x - it is known that it's support of CSS is rather poor, and it concerns &quot;width&quot; property also.
But it does work in Opera 5+, IE5+ and Netscape 6 (by the way, do you know that Netscape 4 and 6 are completely different browsers?)

I suggest to set the width property inside <table> and <td> tags and not in CSS for full cross-browser compatibility.
 
Thanks, starway. Here's what I tried, and it does NOT give me a table width of 100% in Netscape. I have NS 6.2, and I haven't dared to try it with NS 4.X.

<TABLE BGCOLOR=&quot;#0000FF&quot; BORDER=&quot;0&quot; CELLPADDING=&quot;0&quot; CELLSPACING=&quot;0&quot; WIDTH=&quot;100%&quot;>
<TR>
<TD WIDTH=&quot;34%&quot;><SPAN CLASS=&quot;BigBlack&quot;>Service Name</SPAN></TD>
<TD WIDTH=&quot;33%&quot;><SPAN CLASS=&quot;BigBlack&quot;>Document Created</SPAN></TD>
<TD WIDTH=&quot;33%&quot;><SPAN CLASS=&quot;BigBlack&quot;>Document Last Modified</SPAN></TD>
</TR>
</TABLE> Calista :-X
Jedi Knight,
Champion of the Force
 
When I tried your suggestion, it gave me a table just wide enough for the text to fit, and I lost the font definition. (The font diplayed normal size rather than applying the style.) What I don't get is, you're telling me that the code you gave me works for you in NS, so why doesn't it work for me? Calista :-X
Jedi Knight,
Champion of the Force
 
I don't know how can it be - I copied your code, pasted into text editor and saved the html page. It works in N6 and everywhere else as it should: the table is 100%, cell's width is not the same without <TD WIDTH=&quot;33%&quot;>, but when you add it each cell width = 1/3 of page width.
I can't test your text settings because you didn't show it.
 
Thanks, guys! I finally figured out what the problem was. You're right, I did not give you the full context, which is, that this table is nested inside another table to which I did not assign any width attributes. I found that when I put widths on all tables and <TD>s, it worked OK. Calista :-X
Jedi Knight,
Champion of the Force
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top