代码如下:
<HTML>
<HEAD><TITLE>js动态生成表格</TITLE>
<META content="text/html; charset=hz-gb-2312" http-equiv=Content-Type>
</HEAD>
<script>
function creates(){
newiframes=document.createElement("TABLE")
newiframes.id="t1"
newiframes.width="100"
newiframes.border="1"
newiframes.height="100"
newiframes.align="left"
newiframes.style.background="blue"
newiframes.insertRow()
newiframes.rows[0].insertCell()
document.body.insertBefore(newiframes)
}
</script>
<body>
<input type=button value='动态生成表格' οnclick=creates()><br>
</body>
</HTML>