I'm trying to populate a table with some rows everything works good except that only the last row inside the array is actually appended. I really have no idea why. I already printed the array and everything is how it should be.
$table_body = $('#tbody');
$table_row = $('<tr><td style="text-align: center" class="nome"></td><td style="text-align: center" class="email"></td></td><td style="text-align: center" class="confirmado"></td></td><td style="text-align: center" class="dataCandidatura"></td><td class="btn" style="text-align: center"></td></tr>');
for (i in data)
{
var future_field = data[i];
console.log(future_field);
$table_row.find('.nome').html(future_field.nome);
$table_row.find('.email').html(future_field.email);
$table_row.find('.confirmado').html(future_field.confirmed);
$table_row.find('.dataCandidatura').html(future_field.created_at);
// Appending table row to tbody
$table_body.append($table_row);
}
If anyone has some clue I would appreciate it.