function add(){
var tbl = document.getElementById("myTable");
var obj = tbl.insertRow(tbl.rows.length);
obj.insertCell().innerHTML = "1";
obj.insertCell().innerHTML = "2";
obj.insertCell().innerHTML = "3";
obj.onmouseover=function(){markThisTr(obj)};
obj.onmouseout=function(){mouseOut(obj)};
obj.style.textAlign='center';
obj.style.cursor='pointer';
}
var obj = document.getElementById("myTable").insertRow(-1);
obj.insertCell(0).innerHTML = "1";
obj.insertCell(1).innerHTML = "2";
obj.insertCell(2).innerHTML = "3";
用jquery吧
给你个例子做参考