How to get max and min value of columns in data table using jQuery?
How to get max and min value of columns in data table using jQuery?
BelenDG
Posts: 2Questions: 0Answers: 0
Hello, I have a problem,
I have a table and I would like get max number of one column, but i don't know how to do.
I use this code for do the SUM
var table = $("#myTable").DataTable();
$("#myTable").on('search.dt', function() {
$('#areaDate').html(table.column( 3, {page:'current'} ).data().sum());
$('#energyIntensity').html(table.column( 8, {page:'current'} ).data().sum());
});
And now I want to do a MAX of this column.
Could someone help me?
Thanks.
This discussion has been closed.
Replies
Use http://www.w3schools.com/jsref/jsref_min.asp and http://www.w3schools.com/jsref/jsref_max.asp in conjunction with your .data().
Also see
https://jsfiddle.net/nikhilagarwal530/np9L66bv/
Thank's you! I used the 3rd option