日期:2014-05-16 浏览次数:20320 次
<SCRIPT LANGUAGE="JavaScript"> ? ?
<!-- ? ?
function setHiddenCol(oTable,iCol)
{ ? ?
? ? for (i=0;i < oTable.rows.length ; i++) ? ?
? ? { oTable.rows[i].cells[iCol].style.display = oTable.rows[i].cells[iCol].style.display=="none"?"":"none"; ? ? } ? ?
} ? ?
function setHiddenRow(oTable,iRow)
{ ?oTable.rows[iRow].style.display = oTable.rows[iRow].style.display == "none"?"":"none"; ? } ? ?
//--> ? ?
</SCRIPT>?
?
?
<BODY> ? ?
<TABLE id="Table1" cellSpacing="1" cellPadding="1" border="1"> ? ? ?
<TR> <TD>00</TD> <TD>01</TD> <TD>02</TD></TR> ? ?
<TR> <TD>10</TD> <TD>11</TD> <TD>12</TD></TR> ? ?
<TR> <TD>20</TD> <TD>21</TD> <TD>22</TD></TR>?? ?
</TABLE>?
<INPUT id="btnHiddenCol" type="button" value="显示/隐藏第2列" name="btnHiddenCol" onclick="setHiddenCol(document.getElementById('Table1'),1)"> ? ??
<INPUT id="btnHiddenRow" type="button" value="显示/隐藏第2行" name="btnHiddenRow" onclick="setHiddenRow(document.getElementById('Table1'),1)"> ? ??
</BODY>?