我有一个HTML表。我想要的是最后一栏。这些是例外结果
--------------------------------
| Names |Process_id | total|
--------------------------------
|construction 1001 1001 |
|engineering 1005 1005 |
|total 0 2006 |
----------------------------------
请帮我这些
谢谢你。
这样尝试
rowCount = $('#table4 tr:last').index() + 1;
var total_1 = 0;
for (i = 1; i < rowCount; i++) {
var rows = $('#table4 tbody tr');
var cellVal_2 = parseFloat($('#table4 tr:eq(' + i + ')').find("td:last").text().replace(',', ''));
$('#table4 tr td:last').each(function() {
var cellVal_1 = parseFloat($('#table4 tr:eq(' + i + ')').find("td:last").text().replace(',', ''));
if (!isNaN(cellVal_1)) {
total_1 = total_1 + cellVal_1;
}
});
}
$('#table4 tr:last td:last').html(total_1);
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句