let table = document.getElementById("table1"); let trs = table.rows; Array.from(trs) .sort((a, b) => a.cells[0].textContent - b.cells[0].textContent) .forEach(tr => table.appendChild(tr));
let table = document.getElementById("table1"); let trs = table.rows; Array.from(trs) .sort((a, b) => a.cells[0].textContent - b.cells[0].textContent) .forEach(tr => table.appendChild(tr));