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="Content-Type" content="text/html; charset=iso-8859-1">
<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="JAVASCRIPT" SRC="writetable.js"></SCRIPT>
</head>
<body>
<table>
<SCRIPT>
WriteRows();
</SCRIPT>
</body>
</table>
</html>
writetable.js contains:
function WriteRows() {
var open_div = "";
var close_div = "";
var values="helloWorld"
for (var i=0; i<23; i++) {
if(i%2==0)
LineProperties="bgcolor='#CCCCCC'";
else
LineProperties="bgcolor='#99CCFF'";
var vv='';
vv+="<TR "+ LineProperties+">";
for (var j=0; j<10; j++) {
var div_name = "d"+"name"+"-"+i+"-"+j;
open_div = "<ILAYER NAME=\""+div_name+"\" WIDTH=100% >";
open_div+= "<LAYER NAME=\""+div_name+"x\" WIDTH=100% >";
open_div+= "<SPAN CLASS=\"center\">";
close_div = "</SPAN>";
close_div += "</LAYER></ILAYER>";
vv+="<TD >"+open_div+values+close_div+"</TD>";
}
vv+="</TR>";
document.write(vv);
}
}
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="Content-Type" content="text/html; charset=iso-8859-1">
<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="JAVASCRIPT" SRC="writetable.js"></SCRIPT>
</head>
<body>
<table>
<SCRIPT>
WriteRows();
</SCRIPT>
</body>
</table>
</html>
writetable.js contains:
function WriteRows() {
var open_div = "";
var close_div = "";
var values="helloWorld"
for (var i=0; i<23; i++) {
if(i%2==0)
LineProperties="bgcolor='#CCCCCC'";
else
LineProperties="bgcolor='#99CCFF'";
var vv='';
vv+="<TR "+ LineProperties+">";
for (var j=0; j<10; j++) {
var div_name = "d"+"name"+"-"+i+"-"+j;
open_div = "<ILAYER NAME=\""+div_name+"\" WIDTH=100% >";
open_div+= "<LAYER NAME=\""+div_name+"x\" WIDTH=100% >";
open_div+= "<SPAN CLASS=\"center\">";
close_div = "</SPAN>";
close_div += "</LAYER></ILAYER>";
vv+="<TD >"+open_div+values+close_div+"</TD>";
}
vv+="</TR>";
document.write(vv);
}
}