Internet Explorer 9 not rendering table cells properly

后端 未结 14 2184
借酒劲吻你
借酒劲吻你 2020-11-28 02:18

My website has always run smoothly with IE8, IE7, FF, Chrome and Safari. Now I\'m testing it on IE9 and I\'m experiencing a strange problem: in some pages, some tabular data

14条回答
  •  猫巷女王i
    2020-11-28 03:10

    The solution given @Shanison helps only partially but the problem persists if there are spaces between any of the other elements that can be part of the table content model like thead, th etc.

    Here is a better regex devised by my Lead at work.

    if (jQuery.browser.msie && jQuery.browser.version === '9.0')
    {
        data = data.replace(/>\s+(?=<\/?(t|c)[hardfob])/gm,'>');
    }
    

    covering all table, caption, colgroup, col, tbody, thead, tfoot, tr, td, th elements.

    Note: jQuery.browser was removed in jQuery 1.9 and is available only through the jQuery.migrate plugin. Please try to use feature detection instead.

提交回复
热议问题