Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

collapse / expand part of a table

Status
Not open for further replies.

ksbigfoot

Programmer
Apr 15, 2002
856
CA
I have the following code:
Code:
<script type="text/javascript">
function handleClick(Obj,imagen)  {
    if(document.getElementById(Obj).style.display=='none') {
        document.getElementById(Obj).style.display = "";
        document.getElementById(imagen).src="images/minus.gif";
        
    }
      else {
          document.getElementById(Obj).style.display = "none";
          document.getElementById(imagen).src="images/plus.gif";
          
      }
}
</script>
<img src="images/minus.gif" id="gif1" onclick="handleClick('to_col1','gif1')" align="left">
<div id="to_col1">
<table border="1">
<tr>
  <td>Col 1</td>
  <td>Col 2</td>
</tr>
<tr>
  <td>One</td>
  <td>Two</td>
</tr>
<tr>
  <td>Three</td>
  <td>Four</td>
</tr>
</table>
</div>
and I want the heading (Col1 & Col2) to stay, but hide all the rows beneath it (One, Two, Three, Four)
Is that possible?
Or do I have to hide the whole table
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top