JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<head>
</head>
<body>
<button>Click me!</button>
<input id='t1' type='text'/>
<input id='t2' type='text'/>
<table>
<tr><td>a</td><td>c</td></tr>
</table>
</body>
</html>
CSS
table{
width:100%;
background:#eeeeee;
}
JavaScript
function addRowToTable(table, cell1, cell2) {
var row;
row = "<tr><td>" + cell1 + "</td><td>" + cell2 + "</td></tr>";
table.append(row);
}
$(document).ready(function() {
$('button').click(function() {
addRowToTable($('table'), $('#t1').val(), $('#t2').val());
});
});