I am doing something similar, but showing hiding tables, not just their
rows, I'm sure you could modify this script to your needs.
The table starts hidden:
<table width="90%" style="visibility:hidden; position:absolute; width:0;
height:0;">
...
</table>
The button to trigger the show table:
<input name="Button" type="button" class="semivisiBox" id="btnPanel1"
value="Panel1" onClick="getTable('Panel1')">
The Script;
<script language="JavaScript" type="text/JavaScript">
<!--
function getTable(x){
var tableName = "" + "tbl" + x + "";
document.getElementById(tableName).style.visibility = "visible";
document.getElementById(tableName).style.position = "relative";
document.getElementById(tableName).style.width = "";
document.getElementById(tableName).style.height = "";
var buttonName = 'btn' + x;
document.getElementById(buttonName).className = "highloghtBox";
if (x != "Customer")
hideTable("Customer");
if (x != "Panel1")
hideTable("Panel1");
if (x != "Panel2")
hideTable("Panel2");
if (x != "Panel3")
hideTable("Panel3");
if (x != "Panel4")
hideTable("Panel4");
if (x != "Parts")
hideTable("Parts");
}
function hideTable(x){
var tableName = 'tbl' + x;
document.getElementById(tableName).style.visibility = "hidden";
document.getElementById(tableName).style.position = "absolute";
document.getElementById(tableName).style.width = "0";
document.getElementById(tableName).style.height = "0";
var buttonName = 'btn' + x;
document.getElementById(buttonName).className = "semiVisiBox";
}
//-->
</script>
Note that the script also changes the class of the button that called the
table.
The only problem i have is that the page seems to be resizing depending on
the height of the table that is shown, but the containing table (one that is
set to 100% of the page height) is not resizing. Not that i want that table
to resize, i just want to stop the page from doing it.
Ricardo.
"Gareth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>
> I wish to hide/show table rows. Not sure how to do it. Anyone have a
> tutorial or a script writen for this?
>
> Thanks.
>
> Gareth.
>
>
>
>
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/