使用
table.insertRow(),row.insertCell()代替
document.createElement("tr");document.createElement("td");
之后不需要appendChild()
如此即可.
table.insertRow(),row.insertCell()代替
document.createElement("tr");document.createElement("td");
之后不需要appendChild()
如此即可.
再创建个tbody看看吧
//tr1
tempRow = this._viewTable.insertRow();
//td1
tempCell = tempRow.insertCell();
tempCell.width = "20 px";
tempCell.innerHTML = "test";
//td2
tempCell = tempRow.insertCell();
tempCell.style.cssText = "padding-left:8 px; font-size:12 px; color:#808080; font-family:Arial;";
tempCell.innserHTML = this._defaultText;
果然是的,晕...
我按照HTML结构创的,没想到还要个tbody....
揭帖