我一直在寻找如何使用Jquery tablesorter插件(http://mottie.github.com/tablesorter/docs/#Introduction)对混合数字进行排序
当我按总数排序时,它显示如下:
170.5
65.5
63.5
505
263
218
187
所以基本上自动取款机插件只是忽略了“。最高数字是1705。如果我在什么地方错过了答案,我很抱歉。
发布于 2013-02-27 18:43:07
我会检查数字周围的空格,这些空格可能会使tablesorter认为它们是字符串。查看this example -当像这样运行时,它可以正确排序:
<table id="tablesorter" class="tablesorter">
<thead>
<tr>
<th>Mixed Numbers</th>
</tr>
</thead>
<tbody>
<tr>
<td>170.5</td>
</tr>
<tr>
<td>65.5</td>
</tr>
<tr>
<td>63.5</td>
</tr>
<tr>
<td>505</td>
</tr>
<tr>
<td>263</td>
</tr>
<tr>
<td>218</td>
</tr>
<tr>
<td>187</td>
</tr>
</tbody>
</table>
$(function () {
$("#tablesorter").tablesorter({
theme: 'blue',
widgets: ['zebra']
});
});https://stackoverflow.com/questions/15109559
复制相似问题