var tab=document.getElementById("id");
var rows=tab.rows;
alert(rows.length);
for(var i=0;i<rows.length;i++)
{
for(var j=0;j<rows[i].cells.length;j++)
{
rows[i].cells[j].innerHTML="xxx";//修改值
alert("第"+(i+1)+"行,第"+(j+1)+"列的值是:"+rows[i].cells[j].innerHTML);
}
}
内容来源为http://www.jb51.net/article/121223.htm