Retro_1477,
https://javascript.ru/forum/misc/758...tml#post498083
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script>
addEventListener("load", function() {
function init(table) {
const tbody = table.tBodies[0] ;
const collator = new Intl.Collator(["en", "ru"], { numeric: true });
tbody.append(...[...tbody.rows].sort((a, b) => collator.compare(
a.children[1].innerHTML,
b.children[1].innerHTML)))
}
document.querySelectorAll("table").forEach(init)
});
</script>
</head>
<body>
<table>
<tr>
<td>кот</td>
<td>59</td>
<td>купить</td>
</tr>
<tr>
<td>пёс</td>
<td>99</td>
<td>купить</td>
</tr>
<tr>
<td>слон</td>
<td>19</td>
<td>купить</td>
</tr>
</table>
</body>
</html>