📅  最后修改于: 2022-03-11 15:02:23.943000             🧑  作者: Mango
$(function() {
$("#subtotal").html(sumColumn(4));
$("#total").html(sumColumn(5));
});
function sumColumn(index) {
var total = 0;
$("td:nth-child(" + index + ")").each(function() {
total += parseInt($(this).text(), 10) || 0;
});
return total;
}
ClientName
ItemName
Quantity
12
34
ClientName
ItemName
Quantity
56
78
ClientName
ItemName
Quantity
90
12
Totals