我有以下頁腳表:添加使用fnFooterCallback第二總排在jQuery的數據表
<tfoot>
<tr>
<th colspan="9">Total amount:</th>
<th></th>
<th></th>
</tr>
<tr>
<th colspan="9">Grand total:</th>
<th colspan="2"></th>
</tr>
</tfoot>
我使用jQuery的數據表來呈現從MySQL的數據和我使用的第一尾行sumarise從表中的值在兩列,假設金額和SAmount
"fnFooterCallback": function (nRow, aaData, iStart, iEnd, aiDisplay) {
var nCells = nRow.getElementsByTagName('th');
nCells[0].innerHTML = Amount;
var nCells = nRow.getElementsByTagName('th');
nCells[1].innerHTML = SAmount;
});
在第二頁腳行我想插入總量SAmount之間的差異。 如何在第二個頁腳行中插入不同的總行數?
我自己找到它 var secondRow = $(nRow).next()[0]; var nCells = secondRow.getElementsByTagName('td'); – rosuandreimihai