<script language="javascript">
function newTables(){
   var row=document.getElementById("rows");
   var col=document.getElementById("cols");
   var obj= document.getElementById("tbl");
   for(i=0;i<parseInt(row.value);i++)
   {
    R = obj.insertRow();
    for(j=0;j<parseInt(col.value);j++)
    {
     C = R.insertCell();
     C.innerHTML="第"+(i+1)+"行,第"+(j+1)+"个单元格";
    }
   }
}
</script></head>
<body>
<table id="tbl" align="center" bordercolor="#CCCCCC" border="1"></table>
<div align="center">请输入表格的行数:
<input type="text" name="rows" value="">
列数:
<input type="text" name="cols" value="">
<input name="bt" type="button" id="bt" value="GO" onClick="newTables()">
</div>firebug总是说row is null,为什么啊?