2
I use the code below to insert a row in a table:
var linha = "<tr>";
linha += '<td class="cnes">' + cnes + '</td>';
linha += '<td class="cbo">' + cbo + '</td>';
linha += '<td class="profissional">' + profissional + '</td>';
linha += '<td class="procedimento">' + procedimento + '</td>';
linha += '<td class="idade">' + idade + '</td>';
linha += '<td class="quant">' + quant + '</td>';
linha += '<td><button class="btn btn-danger" style="text-align:center;" onclick="remove(this)">Excluir</button></td>'
linha += '</tr>';
$("#tabelaProducao").append(linha);
Since it inserts at the end of it and I need it to be inserted in the second row (the first is the column header). How do I?
Can you give an example of where I should include the
tbody
I usually create the tables without it?– Italo Rodrigo
Yes @Italorodrigo, updated the answer.
– BrTkCa