开发者

deleterow ie8 problem

When I delete the first row in a html table, IE8 leaves a blank line at the end of the table (af开发者_如何转开发ter the footer).

I use the method: objTable.deleteRow(objRow.rowIndex);

My table uses the tag elements: thead, tbody, tfoot.


Are you using YUI? If so, you may be interested in checking out http://developer.yahoo.com/yui/examples/datatable/dt_rowadddelete.html and use their example to see if you encounter the same issues in your browser. If you do, it's probably IE8 issue (most likely,) or a YUI issue.

You may also be interested in trying out something such as jQuery. Much more light weight, and is pretty much cross-browser compatible.


You can try to reset class of table and set up it again (with prototype js, but you can do it by hands):

// Hack. ie8 leaves a blank line at the end of the table, when delete the first row in a html table.
// http://stackoverflow.com/questions/3604183/deleterow-ie8-problem
if (Prototype.Browser.IE && ROW_YOU_DELETE_INDEX == 0) {
    YOUR_TABLE.removeClassName('YOUR_TABLE_CLASS_NAME')
              .addClassName('YOUR_TABLE_CLASS_NAME');
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜