Skip to content

Instantly share code, notes, and snippets.

@aalfiann
Created April 5, 2018 09:49
Show Gist options
  • Save aalfiann/d142d474f88897f1e101edc85d9baf37 to your computer and use it in GitHub Desktop.
Save aalfiann/d142d474f88897f1e101edc85d9baf37 to your computer and use it in GitHub Desktop.
Calculate Sum Collumn jQuery
function calculateColumn(idtable,collumn){
$(function() {
var total = 0;
$(idtable+' tr').each(function(){
var value = parseInt($('td', this).eq(collumn).text());
if (!isNaN(value)){
total += value;
}
});
return total;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment