IE7 problems with displaying text in TD

2019-08-16 22:36发布

问题:

I can not figure out why the text inside the TD is not displayed in IE7. I am frustrated to the core cuz it works in FF! All I am trying to do is dynamically build a table onload... Any help will be greatly appreciated. The complete script is at pastebin

回答1:

User insertRow and insertCell to add Rows and Cells
Ex:

var row = table.insertRow();
row.id= rowid;

var headerCell = row.insertCell();
headerCell.colSpan = colspan;
headerCell.className = "rightAligned";
headerCell.innerHTML = "Header Text";


回答2:

use the insertRow(-1) to add a row instead, and insertCell(-1) to add a column

updated code: http://pastebin.com/mTym410P



回答3:

IE needs a TBODY. Just add it as the first child of your table and then append your rows and cells to that.