sum columns
sum columns
Good afternoon.
I use the template https://datatables.net/extensions/buttons/examples/html5/excelCellShading
$(document).ready(function() {
$('#example').DataTable({
dom: 'Bfrtip',
buttons: [{
extend: 'excelHtml5',
customize: function(xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
// Loop over the cells in column `C`
$('row c[r^="C"]', sheet).each( function () {
// Get the value
if ( $('is t', this).text() == 'New York' ) {
$(this).attr( 's', '20' );
}
});
}
}]
});
});
I need to read the sum of the visible values in several columns (suppose 5 and 6) and put these values in TFOOT.
Tell me, please, how to do this in relation to this code. The options found in the forum do not work.
This question has an accepted answers - jump to answer
Answers
This should work assuming you want the sum visible in the browser as well.
Allan
I'm dumb. Wherever I put this code, it refuses to work.
I managed. Allan, thanks!
I prefer to format the totals thusly:
Thanks!