IE7 problems with displaying text in TD

吃可爱长大的小学妹 提交于 2019-12-13 06:27:20

问题


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.



来源:https://stackoverflow.com/questions/4496041/ie7-problems-with-displaying-text-in-td

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!