使用
table.insertRow(),row.insertCell()代替
document.createElement("tr");document.createElement("td");
之后不需要appendChild()
如此即可.

解决方案 »

  1.   

    在IE下,tr的parentElement是tbody,而不是table,所以你加不上去
    再创建个tbody看看吧
      

  2.   

    用insertRow和insertCell确实比较方便
    //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;
      

  3.   

    zhaoxiaoyang(梅雪香@深圳)
    果然是的,晕...
    我按照HTML结构创的,没想到还要个tbody....
    揭帖