I am trying to add the values of each column and add it in the last row, but I do not see that the content is updated. I build the table in the following way:
echo "<tr>";
echo"<td data-field='count'></td>";
echo"<td data-field='count'>1</td>";
echo"<td data-field='count'>3</td>";
echo"<td data-field='count'>4</td>";
echo"<td data-field='count'>5</td>";
echo"<td data-field='count'>6</td>";
echo "</tr>";
echo "<tr>";
echo"<td data-field='count'></td>";
echo"<td data-field='count'>2</td>";
echo"<td data-field='count'>2</td>";
echo"<td data-field='count'>2</td>";
echo"<td data-field='count'>2</td>";
echo"<td data-field='count'>2</td>";
echo "</tr>";
echo '<tfoot>
<tr>
<td></td>
<td id="total">.</td>
<td id="total">.</td>
<td id="total">.</td>
<td id="total">.</td>
<td id="total">.</td>
</tr>
</tfoot>';
and my jquery will load it with a script with the following content:
var total = 0;
$(data).each(function(i){
total = total+ parseInt(data[i].cound);
});
$('#total').html(total);
Is it possible to use the same function for each column?