//js脚本
先获取id为secTable的表格
取列写作setTable.rows[0].cells.length
<script language=javascript type="text/javascript">
function secBoard(n) {
var secTable=document.getElementById("secTable");
var mainTable=document.getElementById("mainTable");
for (i = 0; i < secTable.rows[0].cells.length; i++)
secTable.rows[0].cells[i].className = "sec1";
secTable.rows[0].cells[n].className = "sec2";
for (i = 0; i < mainTable.tBodies.length; i++)
mainTable.tBodies[i].style.display = "none";
mainTable.tBodies[n].style.display = "block";
}
</script>
<htmL>
<table id="secTable">
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</table >
<table id="mainTable">
<tbody></tbody>
<tbody></tbody>
<tbody></tbody>
</table>
</html>