Solved

<style> works only in the explorer and not in netscape

Posted on 2000-04-16
7
177 Views
Last Modified: 2010-04-09
I run a servlet which creates a html page:

"<html><head><title>Order Form</title>"+
"<center><b>Order Status</b></center>"+
"<table border = 1>"+
"<style TYPE=\"text/css\" >"+
"TABLE { font-size : 9pt;"+
      "color : blue}"+
"TH { font-size : 9pt;"+
"font-weight : bold}"+
"</STYLE>"+
"</head>"+
                                          "<body text=\"000000\" bgcolor=\"ffffff\">"+
                                          "<tr>" + etc, etc, (filling the table with records)

in the internet explorer there's no problem, the table appears exactly as i want but in netscape, the table doesn't appear with the same style and it is also empty, with no records in it.                        

can you tell me what's wrong with the code?                                                                  
0
Comment
Question by:twg
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 8

Expert Comment

by:jbirk
ID: 2720331
You have this line:
"<table border = 1>"+
in the header.  That shouldn't be there.  Maybe it's causing the problem?

Also you should try to put end of lines in the file.  Netscape may be confused by that as well.  What you showed has no enod of lines and will result in one long line of text.

-Josh
0
 

Author Comment

by:twg
ID: 2720452
thanks Josh.
I removed the line <table border=1> and it didn't help.
where do you think I have to put end of lines?
while filling the table with data of after every html line?
0
 
LVL 9

Expert Comment

by:TTom
ID: 2720625
NS is VERY fussy about creating tables.  You MUST have (in the final table)

<table>
<tr>
<td></td>
<td></td>
</tr>
</table>

In particular, leaving out the <table> or </table> tags will abort the display of the table completely (NS MAY forgive not closing <td>s or <tr>s)

If you are very careful about how your table is created by your applet, you should not have a problem.  IE is much more forgiving about these (and other) HTML issues.

Check your HTML code once the page is generated.  I am sure you will discover that one or more of the required tags are missing.  All the code will be there in NS; it just will not render.

Tom
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Accepted Solution

by:
astevens earned 30 total points
ID: 2720984
I decided to test a few of the earlier suggestions.  
I created a page using the same styles as in your example and , additionally, decided to leave out the closing </th> and </td> tags.  Finally, I put all of the markup on one line.  Netscape 4.7 on my windows machine had no problems with this.

I hope this saves you some time.

Code:

<html><head><title>Order Form</title> <style TYPE=text/css > TABLE {  font-size : 18pt; color: blue; } TH { font-size : 9pt; font-weight : bold; } td {color:blue ; font-size:9pt;}</style></head><body bgcolor="ffffff"><table> <tr><th>head</tr><tr><td>cell</tr></table></body></html>

0
 
LVL 8

Expert Comment

by:jbirk
ID: 2721053
Well, I guess the EOLs won't be important for styles then since astevens said it worked for him.  NOrmally with tables it's not a problem either, but the spacing may differ when no EOLs or white space are found between tags.  It should at least load though, even if the spacing is slightly different.

The opening/closing tags do tend to plague NN though as TTom said.  Sometimes it works ok, like in astevens case, and sometimes it does not.  I looked at your code again and noticed no opening <TABLE> tag.  That is very important as is the closing table tag.  The other tags it can deal with sometimes, unless you get complicated nested table structures (it gets even pickier).

Good luck!
-Josh
0
 
LVL 9

Expert Comment

by:TTom
ID: 2722833
I think Josh hit the nail on the head with his initial comment (although not quite completely explained).  Putting the <table> tag above the body of the document probably made it "invisible" to the browser.  In NS, this will abort the rendering of the table.

The simple answer is to move the point at which the <table> tag is inserted to BELOW the <body> tag.

That's what I was getting at with my original comment.

Tom
0
 

Author Comment

by:twg
ID: 2725471
Thanks everyone. I did some changes and finally it worked out.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now