Results 1 to 6 of 6

Thread: Hiding/Showing parts of table

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    Somerset, UK
    Posts
    93

    Hiding/Showing parts of table

    Does anybody know how to show & hide a <td> or <tr> or is it done some other way??

    I want to be able to hide information in a lower part of a table then have an image/hyperlink that will hide or show it.


    d'you catch my drift??


    thanks in advance

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    you can try this, don't know if it work!!

    <table>
    <tr>
    <td id="test">dsfdsfdf</td>
    </tr>
    <table>

    <input type=button onClick="document.all['test'].style.visibility='hidden';" value="hide cell">

    let me know if it works!!

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    Somerset, UK
    Posts
    93

    Unhappy

    It sort 'of works but the <td> that your hiding doesn't shrink.

    The idea is to have a table with 10+ rows, rows 2 - 5 are hidden, so when I click on a Image/Hyperlink rows 2 - 5 will toggle their visibility and pull row 6 underneath row 1

    Similar to the functionality in a treeview control

    Does that make any sense???


  4. #4
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    well you will have to do it will layers i'm afraid,
    !!

  5. #5
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    i don't think you do, check this out:

    Code:
    <html>
    <head>
    <title>Test</title>
    <head>
    <body>
    <table border="1"> 
    <tr> 
    <td id="test">dsfdsfdf</td>
    <td id="test2">asdfjkl;</td>
    </tr> 
    <tr id="test3"> 
    <td>dsfdsfdf(row2)</td> 
    <td>asdfjkl;(row2)</td>
    </tr> 
    <table> 
    <input type=button onClick="document.all['test3'].style.display='block';" value="show cell"> 
    <input type=button onClick="document.all['test3'].style.display='none';" value="hide cell"> 
    </body>
    </html>
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    Somerset, UK
    Posts
    93
    Thanks gwdash Spot on!!

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