Jquery sort table number
程序员文章站
2022-05-25 19:29:05
...
So here is what the column is sorted as:
4,666
141,666
293
341,666
346
461,676
This should be sorted as
293
346
4,666
141,666
341,666
461,676
4,666
141,666
293
341,666
346
461,676
This should be sorted as
293
346
4,666
141,666
341,666
461,676
$(document).ready(function() { $.tablesorter.addParser({ id: 'fancyNumber', is:function(s){return false;}, format: function(s) {return s.replace(/[\,\.]/g,'');}, type: 'numeric' }); $("table").tablesorter({headers: {0: {sorter: 'fancyNumber'}}}); });
上一篇: MySQL主从同步配置记录
下一篇: JS实现php的伪分页_PHP教程