function addRow(){ var t=document.getElementById("t1"); var row=t.insertRow(t.rows.length); var cell1=row.insertCell(0); cell1.innerHTML=document.getElementById("t2").value; var cell2=row.insertCell(1); cell2.innerHTML=document.getElementById("t3").value; }