<HTML>
<SCRIPT LANGUAGE= "JScript ">
function numberCells() {
var count=0;
for (i=0; i < document.all.oTable.rows.length; i++) {
for (j=0; j < document.all.oTable.rows(i).cells.length; j++) {
document.all.oTable.rows(i).cells(j).innerText = count;
count++;
}
}
}
</SCRIPT>
<BODY οnlοad= "numberCells() ">
<TABLE id=oTable border=1>
<TR> <TH> </TH> <TH> </TH> <TH> </TH> <TH> </TH> </TR>
<TR> <TD> </TD> <TD> </TD> <TD> </TD> <TD> </TD> </TR>
<TR> <TD> </TD> <TD> </TD> <TD> </TD> <TD> </TD> </TR>
</TABLE>
</BODY>
</HTML>
得到表行列数
最新推荐文章于 2020-08-04 10:07:59 发布