Netscape problem.

liunx

Guest
Hi all,

I am trying to do alternate colouring of table rows in web browsers IE and Netscape6.0 .There is no problem with IE ,but how to display the same in Netscape.

Can it be done through CSS.

Help me in this regard as i am searching for the code but not achieving it.

Thanks for u r replies.<tr class="odd"><td></td></tr>
<tr class="even"><td></td></tr>

Try
.odd td {background:blue}
.even td {background:blue}

BTW, NS 6.0? Why not work with the much improved 7.0?
I don't think many uses are still using 6.x anymore.6.2 is almost better than 7.0Originally posted by Zach Elfers
6.2 is almost better than 7.0

Not if you know how to code a webpage.
Literally thousands of bugs fixed from 6.2 to 7.0Yah i am using the version 7.0 and it is good(i should say best when compared to 6.0).Still i am not able to get the desired result.

My situation is that the table is already built and in the body onload event i am capturing the table using document.all("tableid") and colouring the alternate row.Netscape is recognising the number of rows the table contains but it is not dynamically painting the rows of a table.

The style sheet is :
<STYLE TYPE="text/css">
<!--
TR.alt {font-size:8pt;background-color=#D7DBE7}
-->
</STYLE>

and i am calling using the foll. javascript function

<script language="JavaScript">
function setRowColor(){
var altcolor = "alt";
var rows = document.all("vtable").rows;
for(r = 0; r < rows.length; r++){
if ((r==0) || (r % 2) == 0){
rows(r).className = altcolor;
}
}
}

Where vtable is the table id.

Is this wrong.

Can any one give me the suggestion/code to get it.

Thanks.var rows = document.all("vtable").rows;

Use the W3C DOM method document.getElementById()

var rows = document.getElementById("vtable").rows;Thanks to all of u, my problem is solved.
 
Back
Top