创建表格
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="javascript">
function createTable(){
var div=document.getElementById("a");
var _table=document.createElement("table");
_table.setAttribute("border","1");
_table.setAttribute("borderColor","black");
_table.setAttribute("width","200");
for(var i=0;i<10;i++)
{
var _tr=_table.insertRow(i);
for(var j=0;j<10;j++)
{
var _td=_tr.insertCell(j);
var _tn=document.createTextNode(i.toString()+j.toString());
_td.appendChild(_tn);
}
}
var _btn=document.createElement("input");
_btn.type="button";
_btn.value="delete";
_btn.onclick=function()
{
div.removeChild(_table);
div.removeChild(_btn);
}
div.appendChild(_btn);
div.appendChild(_table);
}
</script>
</head>
<body>
<input type="button"value="create"/>
<div id="a"></div>
<!-- http://10.71.210.186/indexlogin.html Adminstrator -->
</body>
</html>
<script language ="javascript">
//http://yezi.iteye.com/blog/78619
//http://www.blogjava.net/leeguannan/archive/2007/11/29/164044.html
</script>
页:
[1]