Solved

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

Posted on 2000-04-16
7
180 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
compact pure CSS Read More Toggle 4 59
Using jQuery to set a DIV attribute on page load 9 30
Input box width 6 26
Mobile page Scrolling down when refreshing 4 30
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…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

770 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