https://datatables.net/
示例:
<link rel="stylesheet" href="//cdn.datatables.net/2.0.5/css/dataTables.dataTables.min.css" />
<script type="text/javascript" src="//cdn.datatables.net/2.0.5/js/dataTables.min.js">script>
<script src="//cdn.datatables.net/plug-ins/2.0.5/sorting/file-size.js">script>
<script src="//cdn.datatables.net/plug-ins/2.0.5/sorting/formatted-numbers.js">script>
let table = new DataTable('#detail',{
paging: false,//不启用分页
order:[]//保持原顺序
,columnDefs:[
{ type: 'file-size', targets: sizeI } //按文件大小排序 https://datatables.net/plug-ins/sorting/file-size
,{ type: 'formatted-num', targets: shardI}//尽量按数字排(忽略非数字后缀)
, destroy: true// enable reinit
]
//orderFixed: [$('#detail tr:first th:contains(total size)').index(), 'desc']
});