I would like to know how to realize following project
Actually I have a php code which renders a table
<table id = "oldata" class ="table table-bordered">
<thead>
<tr class ="success">
<th class="text-center">Stage</th>
<th class="text-center">REQUEST</th>
<th class="text-center">REPLY</th>
</tr>
</thead>
<tbody>
<?php
foreach($allinfool as $infool){
print("<tr>");
print("<td>{$infool["Stage"]}</td>");
print("<td class='text-left'>" .nl2br($infool["comment"])."</td>");
print("<td class='text-left'>" .nl2br($infool["resultcom"]). "</td>");
print("</tr>");
}
?>
</tbody>
</table>
So far so good, however I want to build many tables like above based on action from user. I mean he will have a list of items (like choice 1, choice 2, choice 3...) and then by clicking this it will render without reloading the page above html (based on new allinfool array).
My point is I want to do it via Ajax. So far I could manage Ajax but not to render above content of html. I could manage to render back one number or one text but in this case it is more complicated since html is mixed with php. Could you please help me to figure out how to realize this Ajax technique?