<script>
function showtable(n){
var table = document.getElementById("table"+n);
table.style.display = table.style.display=="none"?"":"none";
}
</script>
function showtable(n){
var table = document.getElementById("table"+n);
table.style.display = table.style.display=="none"?"":"none";
}
</script>
<tr>
<td height="25" bgcolor="#6699CC"><table width="150" border="0" align="center" cellpadding="0" cellspacing="2" style="cursor:hand;" onClick="showtable(1)">
<tr>
<td valign="middle">A</td>
</tr>
</table></td>
</tr>
<tr>
<td><table id="table1" width="150" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="#EFEFEF">
<tr>
<td>111</td>
</tr>
</table></td>
</tr>
</table>
<table width="150" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25" bgcolor="#6699CC"><table width="150" border="0" align="center" cellpadding="0" cellspacing="2" style="cursor:hand;" onClick="showtable(2)">
<tr>
<td valign="middle">B</td>
</tr>
</table></td>
</tr>
<tr>
<td><table id="table2" width="150" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="#EFEFEF">
<tr>
<td>22</td>
</tr>
</table></td>
</tr>
</table>
<script>
function showtable(id)
{
if(eval('document.getElementById("table'+id+'").style.display=="none"'))
{
eval('document.getElementById("table'+id+'").style.display=""');
}
else
{
eval('document.getElementById("table'+id+'").style.display="none"');
}
}
</script>完整代码