So a friend and I programmed a dart game with javascript and made a table to submit highscores. The submitting works more or less fine, the only problem is, that we have no idea how to sort the table by the amount of points.

Here's the code for the submitting:

```
function submitScore() {
  var table = document.getElementById("scoreTable");
  var rowCount = table.rows.length;
  var row = table.insertRow(rowCount);
  var cell1 = row.insertCell(0);
  var cell2 = row.insertCell(1);
  var cell3 = row.insertCell(2);
  cell1.innerHTML = document.getElementById("nameInput").value;
  cell2.innerHTML = points;
  cell3.innerHTML = nameofLevel;

  document.getElementById("scoresTitle").style.visibility="visible";
  document.getElementById("submitButton").style.visibility="hidden";
  document.getElementById("nameText").style.visibility="hidden";
}

```

Does anyone have an idea on how to sort the always updated table by points?