Created
April 5, 2018 09:49
-
-
Save aalfiann/d142d474f88897f1e101edc85d9baf37 to your computer and use it in GitHub Desktop.
Calculate Sum Collumn jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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