www.webdeveloper.com
Results 1 to 7 of 7

Thread: Netscape problem.

  1. #1
    Join Date
    Dec 2002
    Location
    Hyderabad
    Posts
    3

    Question Netscape problem.

    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.

    Last edited by kiran; 12-09-2002 at 08:38 AM.
    Kiran

  2. #2
    Join Date
    Nov 2002
    Posts
    984
    <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.
    // Stefan Huszics

  3. #3
    Join Date
    Nov 2002
    Posts
    631
    6.2 is almost better than 7.0

  4. #4
    Join Date
    Nov 2002
    Posts
    984
    Originally 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.0
    // Stefan Huszics

  5. #5
    Join Date
    Dec 2002
    Location
    Hyderabad
    Posts
    3
    Yah 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.
    Kiran

  6. #6
    Join Date
    Nov 2002
    Posts
    4,473

    document.all is IE proprietary code

    var rows = document.all("vtable").rows;
    Use the W3C DOM method document.getElementById()

    var rows = document.getElementById("vtable").rows;

  7. #7
    Join Date
    Dec 2002
    Location
    Hyderabad
    Posts
    3
    Thanks to all of u, my problem is solved.
    Kiran

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles