Hello, I would like to generate a dynamic table in java script (only the tr and the td) so I am using innerHTML.
I make the following code:
objDiv1 = document.getElementById("tabela");
bloco += "<tr><td>"+ Campo+"</td></tr>";
objDiv1.innerHTML = bloco;
It is generating certain html however it is playing up my table.
IfIgetandgiveaconsole.logandpasteinplacewherethisdivisgoingtowork:
Myhtmlstructurelookslikethis:
<tableclass="table">
<thead class=" text-primary">
<th>
Lote
</th>
</thead>
<tbody>
<div id="tabela">
</div>
</tbody>
</table>
What am I doing wrong?