.top_t2_c1{
width:700px;
height:100%;
line-height:50px;
text-align:center;
}
</style>
<script type="text/javascript" language="javascript">
var rows=0;
function addRow(tableName)
{
var row=tableName.insertRow(tableName.rows.length);
rows++;
var col
if(tableName==tabAdd)
{
col=row.insertCell(0);
col.innerHTML="<input type='text' id='name"+rows+"' style='width:290px;' name='name"+rows+"'/>";
col=row.insertCell(1);
col.innerHTML="<input type='button' id='btn"+rows+"' value='删除' onclick='delRow(this);'/>";
}
}
function delRow(o)
{
var objTR =o.parentNode.parentNode;
var currRowIndex= objTR.rowIndex;
if(confirm("您确认要删除?"))
{
objTR.parentNode.deleteRow(currRowIndex);
}
}
</script>
</head>
<body>
<form id="Form1" method="post" action="savamb.asp">
<div align="center" style="Height:100%;">
<h1>输入目标</h1>
<table id="tabAdd" width="330" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#67b2ec" bordercolordark="#ffffff">
<tr>
<td width="290" class="left"><strong>内容</strong></td>
<td class="left" style="TEXT-ALIGN:center;width:40px"><strong>删除</strong></td>
<tr>
</table>
<div class="top_t2_c1" >
<input type="button" onclick="addRow(tabAdd);" name="btnAdd" value="添加行">
</div>
</div>
</form>
就保存目标 |