function add_row(tbName){ var tableobj=document.getElementById(tbName); var rowobj=tableobj.insertRow(tableobj.rows.length);
var cell1=rowobj.insertCell(rowobj.cells.length); var cell2=rowobj.insertCell(rowobj.cells.length); var cell3=rowobj.insertCell(rowobj.cells.length); var stri ='stname_'+(tableobj.rows.length-1);
cell1.innerHTML="
"; cell2.innerHTML="
"; cell3.innerHTML="
"; }
function delete_row(i){ var tableobj=document.getElementById('table_1'); var stTest =document.getElementById('stname_'+ i); if(confirm("你确定要删除“"+stTest.options[stTest.selectedIndex].text+"”?")==true) { tableobj.deleteRow(i); } }
function leo(tbName){//当删除一行后,对各行重新建立索引!!! ——leo
var tableobj=document.getElementById('table_1'); for(i=1;i<tableobj.rows.length;i++) { var stri ='stname_'+i; tableobj.rows[i].cells[0].innerHTML="