PDA

Click to See Complete Forum and Search --> : Hiding/Showing parts of table


josmond
Aug 14th, 2001, 03:35 PM
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

sebs
Aug 15th, 2001, 07:25 AM
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!!

josmond
Aug 15th, 2001, 07:37 AM
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???

:(

sebs
Aug 15th, 2001, 07:41 AM
well you will have to do it will layers i'm afraid,
!!

gwdash
Aug 15th, 2001, 11:18 AM
i don't think you do, check this out:


<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>

josmond
Aug 15th, 2001, 11:31 AM
Thanks gwdash :D Spot on!!