I have a normal datatable that outputs information and a few columns have numbers in them. Is it possible at the bottom of each column to do a tally on the total count in that column?
@foreach($res as $r)
<tr>
<td>
{{-- {{ $user->fname }} {{ $user->lname }} --}}
{{ $r['name'] ?? null }}
</td>
<td>
{{ $r[$threelastYearTitle] ?? 0 }}
</td>
<td>
{{ $r[$twolastYearTitle] ?? 0 }}
</td>
<td>
{{ $r[$onelastYearTitle] ?? 0 }}
</td>
<td>
{{ $r['booked']['onelastYearTitle']}}
</td>
<td>
{{ $r[$currentYearTitle] ?? 0 }}
</td>
<td>
{{ $r['booked']['currentYear']}}
</td>
<td>
<a class="btn btn-default" href="/admin/user/{{ $id }}/edit">Edit</a>
</td>
</tr>
@endforeach
</table>
$('#myTable').DataTable({
"order": [],
// "scrollX": true,
"columnDefs": [ {
"targets" : 'no-sort',
"orderable": false,
"language": {
"search": "Filter records:"
}
}],
"pageLength": 25
});