JSFiddle - React, Tailwind, and code Playground

by Fernando De Leon

HTML

<table id="tblEntAttributes">
   <thead>
     <tr>
       <th>Name</th>
       <th>Surname</th>
     </tr>
   </thead>
   
</table>

<button id="test">appendTo</button>
<button id="test2">append</button>

CSS

#tblEntAttributes td{
 padding: 5px;       
}

JavaScript

var newRowContent = "<tbody><tr><td>newcontent</td><td>newcontent2</td></tr></tbody>";

$("#test").click(function(){    
    $(newRowContent).appendTo($("#tblEntAttributes"));
});
$("#test2").click(function(){    
   $("#tblEntAttributes").append(newRowContent);
});