0
I’m doing a college exercise, and when I click the resposable button for listing, my table is redone whole, so I lose the names that should be on the first line, which are:
-Codigo
-Limite do Prazo
-Nome do Usuario
-Categoria
-Comentarios
However, the first line is already replaced by the bank’s information
<div class="col-md-12">
<h3>Listagem</h3>
<section>
<button id="btListar" class="btn btn-info">Listar Atendimentos</button>
<br />
<br />
<table class="table" id="tabelaLista" border="3">
<thead class="thead-dark">
<tr>
<td>Codigo</td>
<td>Limite do Prazo</td>
<td>Nome do Usuario</td>
<td>Categoria</td>
<td>Comentarios</td>
</tr>
</thead>
</table>
</section>
</div>
var auxHTML = '';
listaObjetos = JSON.parse(resposta);
var total = listaObjetos.length;
for (var i = 0; i < total; i++) {
auxHTML += '<tr>' +
'<td>' + listaObjetos[i].code + '</td>' +
'<td>' + listaObjetos[i].deadline + '</td>' +
'<td>' + listaObjetos[i].userName + '</td>' +
'<td>' + listaObjetos[i].category + '</td>' +
'<td>' + listaObjetos[i].comments + '</td>' +
'</tr>';
}
$('#tabelaLista').html(auxHTML);
@user140828 It worked perfectly! I would like to add the correction so I can mark it?
– Ravel Sbrissa Okada