【发布时间】:2010-10-09 21:07:30
【问题描述】:
我制作了一个带有thead(标题)的表格;在 Mac 上,在 Firefox 中一切都很好,但在 Internet Explorer 6 上,头部就消失了……
知道为什么吗?
这里是测试它的链接:http://www.acecrodeo.com/new/05-rodeos.php... 该表是在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();
});
};
...来自页面上的列表:
<ul>
<li> Date*Endroit*Sanction</li>
<li> 29 Mars & 5 Avril*St-Évariste, Beauce # 1*Équipe Rodéo du Qc.</li>
<li> 12 & 19 Avril*St-Évariste, Beauce # 2*Équipe Rodéo du Qc.</li>
<!-- ... -->
</ul>
【问题讨论】:
-
我在代码中根本找不到任何 THEAD...
-
表格是JS从列表中构建的。
标签: javascript html internet-explorer dom