function setTableOverflow(){
	var th = document.getElementById("tablehead");
	var tb = document.getElementById("tablebody");
	var bodyh = document.body.clientHeight;
	var con = tb.rows.item(0).cells.length;
	var ot = document.getElementById("infot").clientHeight;
	document.getElementById("cov").style.height = bodyh-ot+"px";
	for(i=0;i<con;i++){
		th.rows.item(0).cells[i].style.width = tb.rows.item(0).cells[i].clientWidth+"px";
		}
	th.style.width = tb.clientWidth;
	}
	
var num = 0; 
function addRow(){ 
	num = num + 1; 
	var newTr =document.getElementById("tablebody").insertRow(-1); 
	var td_1 = newTr.insertCell(0); 
	var td_2 = newTr.insertCell(1); 
	var td_3 = newTr.insertCell(2);
	var td_4 = newTr.insertCell(3);
	td_1.style.background = "#CCCCCC";
	td_2.style.background = "#CCCCCC";
	td_3.style.background = "#CCCCCC";
	td_4.style.background = "#CCCCCC";
	td_1.innerHTML = "ID_"+num;
	td_2.innerHTML = "NAME_"+num; 
	td_3.innerHTML = "AGE_"+num;
	td_4.innerHTML = "<a onclick=\"delRow(this)\">删除</a>";
	setTableOverflow();
	}

function delRow(obj){
	var i = obj.parentNode.parentNode.rowIndex; 
	obj.parentNode.parentNode.parentNode.parentNode.deleteRow(i);
	setTableOverflow();
}