粗略的写了一下,给你提供一个思路:
<table id='table'>
<tr>
<td>
<input type='text' name='t1'>
<input type='button' name='b1' value='button1'>
<input type='text' name='t2'>
<input type='button' name='b2' value='button2'>
</td>
</tr>
</table>
<p align='center'><input type='button' onclick='hide()'></p>
<script language='JavaScript'>
function hide(){
if(table.rows[0].style.display != 'none'){
table.rows[0].style.display = 'none';
}else
table.rows[0].style.display = 'block';
}
</script>
<table id='table'>
<tr>
<td>
<input type='text' name='t1'>
<input type='button' name='b1' value='button1'>
<input type='text' name='t2'>
<input type='button' name='b2' value='button2'>
</td>
</tr>
</table>
<p align='center'><input type='button' onclick='hide()'></p>
<script language='JavaScript'>
function hide(){
if(table.rows[0].style.display != 'none'){
table.rows[0].style.display = 'none';
}else
table.rows[0].style.display = 'block';
}
</script>
row.style.display = "none";
如果是隐藏表格里的内容的话可以用
row.cells[index].children[index].style.display = "" or "none";