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

problem in writing table in NS4

Status
Not open for further replies.

siiann

Programmer
Joined
Jul 24, 2003
Messages
2
Location
US
Hi,
I am creating a table in NS4 through javascript's document.write().It has a ILAYER and LAYER tag within each td so that i can access individual cells later.The problem is that before displaying the table it writes something on the page.This junk is then overwritten by actual table.Can anyone please help me so that this junk doesn't show up at all.In actual code i load the table with contents from database query but for simplicity i have used a constant value for all table cells here.Thanks in advance for any help.The relevant portion of code is pasted below:

<html>
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<STYLE type=text/css>
.rel {POSITION: relative; width:100%;}
.abs {POSITION: absolute; width:100%;}
.right {font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align:right; }
.left {font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align:left; }
.center {font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align:center; }
</STYLE>
<SCRIPT></SCRIPT>
<SCRIPT LANGUAGE=&quot;JAVASCRIPT&quot; SRC=&quot;writetable.js&quot;></SCRIPT>
</head>
<body>
<table>
<SCRIPT>
WriteRows();
</SCRIPT>
</body>
</table>
</html>

writetable.js contains:

function WriteRows() {
var open_div = &quot;&quot;;
var close_div = &quot;&quot;;
var values=&quot;helloWorld&quot;
for (var i=0; i<23; i++) {
if(i%2==0)
LineProperties=&quot;bgcolor='#CCCCCC'&quot;;
else
LineProperties=&quot;bgcolor='#99CCFF'&quot;;

var vv='';
vv+=&quot;<TR &quot;+ LineProperties+&quot;>&quot;;
for (var j=0; j<10; j++) {
var div_name = &quot;d&quot;+&quot;name&quot;+&quot;-&quot;+i+&quot;-&quot;+j;
open_div = &quot;<ILAYER NAME=\&quot;&quot;+div_name+&quot;\&quot; WIDTH=100% >&quot;;
open_div+= &quot;<LAYER NAME=\&quot;&quot;+div_name+&quot;x\&quot; WIDTH=100% >&quot;;

open_div+= &quot;<SPAN CLASS=\&quot;center\&quot;>&quot;;
close_div = &quot;</SPAN>&quot;;
close_div += &quot;</LAYER></ILAYER>&quot;;


vv+=&quot;<TD >&quot;+open_div+values+close_div+&quot;</TD>&quot;;
}
vv+=&quot;</TR>&quot;;
document.write(vv);
}


}
 
If you're going to be doing any coding for NS4, you'd better head to the store and buy yourself the biggest bottle of aspirin you can find - you're going to need it!

NS4 is sooooooooooo outdated and supports little of what is being used today. Go to the HTML forum and do a search on NS4 then read through some of the problems that are out there. Also, NS4 is used by such a tiny fraction of users as to be truly not worthy of your time and talents - unless you're into self punishment!

Moral - don't waste your time coding for NS4!

There's always a better way. The fun is trying to find it!
 
Couldn't agree more with tviman's comments. If people are too lazy / stubborn to go and get a recent version of a standards compliant browser, why should you bust a gut building sites just for them?

Build to the standard, not to the browsers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top