为什么我的网站没有出现在Internet Explorer中? [英] Why is my thead not appearing in Internet Explorer?

查看:126
本文介绍了为什么我的网站没有出现在Internet Explorer中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个 thead (header)的表;在Mac上,在Firefox中,一切都很好,但是在Internet Explorer 6上,头只是走了...

I have made a table with a thead (header); on a Mac, and in Firefox everything is fine, but on Internet Explorer 6 the head is just gone...

任何想法为什么?

以下是测试它的链接: http:// www.acecrodeo.com/new/05-rodeos.php ...该表格在 tablerize.js 中构建:

Here is the link to test it: http://www.acecrodeo.com/new/05-rodeos.php... The table is constructed in tablerize.js:

jQuery.fn.tablerize = function() {
    return this.each(function() {
        var table;
        $(this).find('li').each(function(i) {
            var values = $(this).html().split('*');
            if(i == 0) {
                table = $('<table>');
                var thead = $('<thead>');
                $.each(values, function(y) {
                    thead.append($('<th>').html(values[y]));
                });
                table.append(thead);
            } else {
               var tr = $('<tr>');
               $.each(values, function(y) {
                   tr.append($('<td>').html(values[y]));
               });
               table.append(tr);
            }
        });
        $(this).after(table).remove();
    });
};

...从页面上的列表:

...from a list on the page:

<ul>

<li>&nbsp; Date*Endroit*Sanction</li>
<li>&nbsp; 29 Mars &amp; 5 Avril*St-&Eacute;variste, Beauce&nbsp; # 1*&Eacute;quipe Rod&eacute;o du Qc.</li>
<li>&nbsp; 12 &amp; 19 Avril*St-&Eacute;variste, Beauce&nbsp; # 2*&Eacute;quipe Rod&eacute;o du Qc.</li>
<!-- ... -->
</ul>


推荐答案

好吧,因为我是tablerize的作者以及修复它。

Well since I'm the author of tablerize I might as well fix it.

jQuery.fn.tablerize = function() {
    return this.each(function() {
        var table = $('<table>');
        var tbody = $('<tbody>');
        $(this).find('li').each(function(i) {
            var values = $(this).html().split('*');
            if(i == 0) {
                var thead = $('<thead>');
                var tr = $('<tr>');
                $.each(values, function(y) {
                    tr.append($('<th>').html(values[y]));
                });
                table.append(thead.append(tr));
            } else {
               var tr = $('<tr>');
               $.each(values, function(y) {
                   tr.append($('<td>').html(values[y]));
               });
               tbody.append(tr);
            }
        });
        $(this).after(table.append(tbody)).remove();
    });
};

应该这样做。

这篇关于为什么我的网站没有出现在Internet Explorer中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆