JSFiddle - React, Tailwind, and code Playground
HTML
<div id="parent">
<div class="child">
<table>
<tr onlick='AjaxAddChild()'>
<td>icon<td>
<td>text<td>
<tr>
</table>
</div>
</div>
JavaScript
function AjaxAddChild()
{
// Ajax request for data
var newChild = $("<div class=\"child\"><table>.. AJAX DATA ..</table></div>");
var width = 0;
$("#parent").append(newChild);
$(".child").each(function(){
// HERE i got wrong width of new added child
width += $(this).width();
});
}