get sum of all columns at tfooter
get sum of all columns at tfooter
ASHFAQAHMED
Posts: 6Questions: 0Answers: 0
hello all,
i am trying to get the sum of each column, how should i do that ?
i have used a table on more then 12 pages, and defined at first home page which is included at all pages,
here is code with i want to show the sum of each column
$('#example').dataTable(
{
//"bJQueryUI": true,
"sScrollX": "110%",
"bScrollCollapse": true,
"iDisplayLength": 10,
////// add more show per page list "aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]];
"sDom": 'rt<"bottom"iflp<"clear">>',
"sPaginationType": "full_numbers"
} )
Thanks
i am trying to get the sum of each column, how should i do that ?
i have used a table on more then 12 pages, and defined at first home page which is included at all pages,
here is code with i want to show the sum of each column
$('#example').dataTable(
{
//"bJQueryUI": true,
"sScrollX": "110%",
"bScrollCollapse": true,
"iDisplayLength": 10,
////// add more show per page list "aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]];
"sDom": 'rt<"bottom"iflp<"clear">>',
"sPaginationType": "full_numbers"
} )
Thanks
This discussion has been closed.
Replies
[code]
$('#example').dataTable()._('td:nth-child(4)')
[/code]
That will give you an array of data from the 4th column which you can sum as you would do any other array :-)
Allan
any example for this ? i have tried but can not have the values for the columns
Thanks
Allan
Thanks
Allan
[code]
$(document).ready(function() {
$('#example').dataTable( {
"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
var iTotalCases = 0;
for ( var i=0 ; i
Thanks