web-cheat/tablesort.html
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Tablesort</title>
<style>
</style>
</head>
<body>
<table id='table-id' class='sort'>
<thead>
<tr>
<th>String col</th>
<th>Integer col</th>
<th>Float col</th>
</tr>
</thead>
<tbody>
<tr>
<td>ab</td>
<td>2</td>
<td>10.1</td>
</tr>
<tr>
<td>a</td>
<td>10</td>
<td>10.2</td>
</tr>
<tr>
<td>c</td>
<td>2</td>
<td>3.4</td>
</tr>
</tbody>
</table>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/tablesort.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/sorts/tablesort.date.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/sorts/tablesort.dotsep.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/sorts/tablesort.filesize.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/sorts/tablesort.monthname.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/sorts/tablesort.number.min.js"></script>
<script>
window.onload = function() {
const tables = document.getElementsByTagName('table');
for(let i = 0; i < tables.length; ++i) {
const table = tables[i];
new Tablesort(table);
}
}
</script>
</body>
</html>