Solved

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

Posted on 2000-04-16
7
183 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
One field not displaying content (ASP Classic) 8 29
jQuery Sticky Menu 24 36
How to resize a div in html 3 38
IF statment In Powershell 12 16
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.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

839 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