JSFiddle - React, Tailwind, and code Playground
HTML
<table id="editTable">
<tr>
<td>table</td>
<td>data</td>
</tr>
<tr>
<td>DATA2</td>
</tr>
<tr>
<td>DATA3</td>
</tr>
</table>
JavaScript
var table = document.getElementById("editTable");
var row = table.insertRow(-1);
var remove = document.createElement("input");
//Append input first so you can get it's parent
var td1 = row.insertCell(-1)
.appendChild(remove);
remove.type = "button";
remove.value = "Remove";
remove.onclick = function () {
var parent = this.parentNode.parentNode; //get the row node
table.deleteRow(parent.rowIndex - 1); //Delete the row index behind it.
};