JSFiddle - React, Tailwind, and code Playground

HTML

<p>Click the button to insert new cell(s) at the beginning of the table row.</p>

<table>
  <tr>
    <td>First cell</td>
    <td>Second cell</td>
    <td>Third cell</td>
  </tr>
</table><br>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
    console.log(document.getElementsByTagName("table")[0].rows);
    var row = document.getElementsByTagName("table")[0].rows[0];
    var x = row.insertCell(0);
    x.innerHTML = "New cell";
}
</script>