日期:2014-05-16 浏览次数:20397 次
<table width="200" border="1"> <tr> <td>aaa</td> <td>bbb</td> <td>cccc</td> </tr> <tr> <td>111</td> <td>222</td> <td>333</td> </tr> <tr> <td>rrf</td> <td>ssa</td> <td>gtt</td> </tr> </table>
<table width="200" border="1" id="tab"> </table> <SCRIPT LANGUAGE="JavaScript"> <!-- var arr = []; arr[arr.length] = ["aaa","bbb","cccc"]; arr[arr.length] = ["111","222","333"]; arr[arr.length] = ["rrf","ssa","gtt"]; var tab = document.getElementById("tab"); for (var i=0; i<arr.length; i++) { var newrow = tab.insertRow(); for (var j=0; j<arr[i].length; j++) { var newcell = newrow.insertCell(); newcell.innerHTML = arr[i][j]; } } //--> </SCRIPT>