<html>
<head>
<script type="text/javascript">
function show()
{
var tab = document.getElementById("test") ;
//表格行数
var rows = tab.rows.length ;
//表格列数
var cells = tab.rows.item(0).cells.length ;
alert("行数"+rows+"列数"+cells);
}
</script>
</head>
<body>
<table id="test" border="1">
<tr>
<td> </td><td>nbsp;</td>
</tr>
<tr>
<td> </td><td>nbsp;</td>
</tr>
</table>
<input type="button" onclick="show();"/>
</body>
</html>
posted on 2008-01-13 19:41
Ke 阅读(4929)
评论(1) 编辑 收藏 所属分类:
javascript