ikmb@163.com
2.js
1.table中添加
<tfoot>
<tr>
<td><b>当前页合计</b>
</td>
<td id="weightsum">
</td>
<td>
</tr>
</tfoot>
2.js
var addd=0;
$(document).ready(function() {
$('#table1').dataTable({
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
if(iDisplayIndex==0) addd=0;
addd+=parseFloat(aData[1]);//第几列
$("#weightsum").html(formatFloat(addd,3));
return nRow;
}
}
);
} );