<script language="javascript">
var i=0;
function add() {
while(i<7)
{
i++;
var tbl = document.all.tb;
var tr = tbl.insertRow();
var td = tr.insertCell();
td.innerHTML = "<input type=button name=dd value = dd"+i+">"
alert(i);
}
}
</script>
<body onload="add()">
<table id=tb >
</table>
</body>
我实现了,代码与大家共享。