Results 1 to 3 of 3

Thread: Hiding Rows

  1. #1

    Thread Starter
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Hiding Rows

    Hi,
    Is ther any way i can find out how many rows a table contains and cyle through each rows.

    e.g. [psudocode]

    for (i=0;i<document.tables['table1'].rows.length();i++)
    {
    document.tables['table1'].rows[0].styles.display="none";
    }

    Basically i am trying to hide certain rows(more then one) in a table.

    Any Ideas?

    Thanks for your help.

    Danial
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Code:
    function allRows(table)
    {
      return table.getElementsByTagName("tr");
    }
    This is very simple code and it fails for nested tables, because given an outer table it returns all rows of inner tables too.

    Of course, nested tables shouldn't be there anyway.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Originally posted by CornedBee
    Code:
    function allRows(table)
    {
      return table.getElementsByTagName("tr");
    }
    This is very simple code and it fails for nested tables, because given an outer table it returns all rows of inner tables too.

    Of course, nested tables shouldn't be there anyway.
    Yes very simple and exactly what i was looking for. Thank you very much.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

Posting Permissions

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



Click Here to Expand Forum to Full Width