<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>