var newCell=newRow.insertCell(index++);//newRow为insertRow的一行 newCell.id= "td1"; newCell.className="样式名称";//或者newCell.setAttribute("class","样式名称");