jquery - How to calculate Last column total -
i have 1 html table. want last column total. these excepting result
-------------------------------- | names |process_id | total| -------------------------------- |construction 1001 1001 | |engineering 1005 1005 | |total 0 2006 | ----------------------------------
please me these
thank you.
try
rowcount = $('#table4 tr:last').index() + 1; var total_1 = 0; (i = 1; < rowcount; i++) { var rows = $('#table4 tbody tr'); var cellval_2 = parsefloat($('#table4 tr:eq(' + + ')').find("td:last").text().replace(',', '')); $('#table4 tr td:last').each(function() { var cellval_1 = parsefloat($('#table4 tr:eq(' + + ')').find("td:last").text().replace(',', '')); if (!isnan(cellval_1)) { total_1 = total_1 + cellval_1; } }); } $('#table4 tr:last td:last').html(total_1);
Comments
Post a Comment