JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="//cdn.datatables.net/1.10.21/css/jquery.dataTables.min.css">
<script src="//cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"></script>
<table id="example">
<thead>
<tr>
<th>example 1</th>
<th>example 2</th>
<th>example 3</th>
<th>example 4</th>
<th>example 5</th>
<th>Max</th>
</tr>
</thead>
<tbody>
<tr>
<td>first item</td>
<td>1.2345</td>
<td>2.3456</td>
<td>3.4567</td>
<td>4.5678</td>
<td></td>
</tr>
<tr>
<td>second item</td>
<td>9.8765</td>
<td>3.5454</td>
<td>4.2627</td>
<td>8.2354</td>
<td></td>
</tr>
<tr>
<td>third item</td>
<td>8.5678</td>
<td>3.5601</td>
<td>0.0121</td>
<td>1.3254</td>
<td></td>
</tr>
</tbody>
</table>
JavaScript
$(document).ready(function () {
var table = $('#example').DataTable({
columnDefs: [
{
targets: -1,
render: function (data, type, row) {
return Math.max(row[1], row[2], row[3], row[4]);
}
}
]
});
table.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
var data = this.data();
var values = data.slice(1).map(Number);
console.log( data[0] + ': ' + Math.max( ...values ) );
} );
});