我在客户端系统(版本11.0.9600.18161)上的IE11和Chrome(版本50.0.2661.102 m)上使用jquery tablesorter,表格不会通过单击标题进行排序在IE浏览器查看控制台后,我看到:IE11上的jquery tablesorter未封闭标签
HTML1509: Unmatched end tag.
我已经看过了生成HTML,可以看到:
<colgroup class="tablesorter-colgroup">
<col style="width: 8.5%;">
<col style="width: 9.8%;">
<col style="width: 7.6%;">
<col style="width: 6.8%;">
<col style="width: 22%;">
<col style="width: 8.6%;">
<col style="width: 9.2%;">
<col style="width: 12.9%;">
<col style="width: 14.1%;">
</colgroup>
的来源是所有浏览器一样,虽然这是在Firefox中也一样,firefox不报告任何问题,一切正常,但这看起来不对,我为什么不这样做有没有关闭'col'标签?
这是我的呼吁的tablesorter:
$(objLocTable).tablesorter({theme:'blue'
,showProcessing:true
,widthFixed:false
,widgets:['zebra'
,'scroller']
,widgetOptions:{scroller_fixedColumns:2
,scroller_height:400
,scroller_upAfterSort:true
,scroller_jumpToHeader:true}})
.tablesorterPager({container:$('.pager')});
我在函数“sortNatural”找到了一个错误,如果A或B不是字符串的例行程序错误,但没有错误处理所以排序没有完成。
我不能告诉你,为什么a或b不会是一个字符串,看着他们应该是的数据集,但单步调试显示其中一个参数为null,并且这个函数会关闭函数。
我已经用try/catch子句围绕函数内容解决了这个问题。
我认为这应该是选择的答案。另外,如果确实存在问题,我会将错误报告给tablesorter的创建者:http://tablesorter.com/docs/。这是他的错,如果它不工作在IE –
widthFixed没有设置,所以它会使用默认值。我现在把它设置为假,但我仍然遇到同样的问题。控制台仍然报告未封闭的标签,我已经检查过HTML并且没有其他未封闭的标签。 colgroup和col标签仍然存在。 – SPlatten
@JaredBeach LOL我维护一个[fork of tablesorter](http://mottie.github.io/tablesorter/docs/),这对tablesorter来说确实不成问题。 @SPlatten,看看[这个演示](http://jsfiddle.net/Mottie/r25tag6k/3/)没有'