<table id="table1" name="table1">
<tr>
<td><input type="text" name="weProvide" id="weProvide1" size="10"/></td>
<td><input type="text" name="weProvide" id="weProvide2" size="10"/></td>
<td><input type="text" name="weProvide" id="weProvide3" size="10"/></td>
<td><input type="text" name="weProvide" id="weProvide4" size="10"/></td>
<td></td>
</tr>
<tr>
<td><input type="text" name="weProvide" id="weProvide5" size="10"/></td>
<td><input type="text" name="weProvide" id="weProvide6" size="10"/></td>
<td><input type="text" name="weProvide" id="weProvide7" size="10"/></td>
<td><input type="text" name="weProvide" id="weProvide8" size="10"/></td>
<td></td>
</tr>
<tr>
<td><input type="text" name="weProvide" id="weProvide9" size="10"/></td>
<td><input type="text" name="weProvide" id="weProvide10" size="10"/></td>
<td><input type="text" name="weProvide" id="weProvide11" size="10"/></td>
<td><input type="text" name="weProvide" id="weProvide12" size="10"/></td>
<td><div class="red_color" οnclick="insertRow1()">增加行</div></td>
</tr>
</table>
<script type="text/javascript">
function insertRow1() {
var tablelength = document.getElementById("table1");
if(tablelength.rows.length>5) {
alert("不能在增加了!");
return false;
}
newline = document.all.table1.insertRow();
var newcell1 =(newline.insertCell().innerHTML='<input type="text" name="weProvide" size="10"/>');
var newcell2 =(newline.insertCell().innerHTML='<input type="text" name="weProvide" size="10"/>');
var newcell3 =(newline.insertCell().innerHTML='<input type="text" name="weProvide" size="10"/>');
var newcell4 =(newline.insertCell().innerHTML='<input type="text" name="weProvide" size="10"/>');
var newcell5 =(newline.insertCell().innerHTML='<div class="red_color" οnclick="del1()">删除行</div>');
}
function del1() {
document.all.table1.deleteRow(window.event.srcElement.parentElement.parentElement.rowIndex);
}
</script>