我有像这样的数据表
<table id="tbl-cfrmvsreal" class="dataTable table table-bordered table-hover table-full-width" width="100%" data-table="tablekk" data-detail="dthkksub">
<thead>
<tr>
<th rowspan="2">FACTORY NAME</th>
<th rowspan="2">CURRENCY</th>
<th colspan="3">JAN</th>
<th colspan="3">FEB</th>
<th colspan="3">MAR</th>
<th colspan="3">APR</th>
<th colspan="3">MAY</th>
<th colspan="3">JUN</th>
<th colspan="3">JUL</th>
<th colspan="3">AUG</th>
<th colspan="3">SEP</th>
<th colspan="3">OCT</th>
<th colspan="3">NOV</th>
<th colspan="3">DEC</th>
<th colspan="2">TOTAL <label id="tahun"></label></th>
</tr>
<tr>
<th>CFMD ORDER/ PROJECTION AMOUNT</th>
<th>AMOUNT REALISASI EXPORT</th>
<th>%</th>
<th>CFMD ORDER/ PROJECTION AMOUNT</th>
<th>AMOUNT REALISASI EXPORT</th>
<th>%</th>
<th>CFMD ORDER/ PROJECTION AMOUNT</th>
<th>AMOUNT REALISASI EXPORT</th>
<th>%</th>
<th>CFMD ORDER/ PROJECTION AMOUNT</th>
<th>AMOUNT REALISASI EXPORT</th>
<th>%</th>
<th>CFMD ORDER/ PROJECTION AMOUNT</th>
<th>AMOUNT REALISASI EXPORT</th>
<th>%</th>
<th>CFMD ORDER/ PROJECTION AMOUNT</th>
<th>AMOUNT REALISASI EXPORT</th>
<th>%</th>
<th>CFMD ORDER/ PROJECTION AMOUNT</th>
<th>AMOUNT REALISASI EXPORT</th>
<th>%</th>
<th>CFMD ORDER/ PROJECTION AMOUNT</th>
<th>AMOUNT REALISASI EXPORT</th>
<th>%</th>
<th>CFMD ORDER/ PROJECTION AMOUNT</th>
<th>AMOUNT REALISASI EXPORT</th>
<th>%</th>
<th>CFMD ORDER/ PROJECTION AMOUNT</th>
<th>AMOUNT REALISASI EXPORT</th>
<th>%</th>
<th>CFMD ORDER/ PROJECTION AMOUNT</th>
<th>AMOUNT REALISASI EXPORT</th>
<th>%</th>
<th>CFMD ORDER/ PROJECTION AMOUNT</th>
<th>AMOUNT REALISASI EXPORT</th>
<th>%</th>
<th>CFMD ORDER/ PROJECTION AMOUNT</th>
<th>AMOUNT REALISASI EXPORT</th>
</tr>
</thead>
<tfoot>
<tr>
<th> </th>
<th>USD</th>
<th><span id="janorderusd"></span></th>
<th><span id="janactusd"></span></th>
<th> </th>
<th><span id="feborderusd"></span></th>
<th><span id="febactusd"></span></th>
<th> </th>
<th><span id="marorderusd"></span></th>
<th><span id="maractusd"></span></th>
<th> </th>
<th><span id="aprorderusd"></span></th>
<th><span id="apractusd"></span></th>
<th> </th>
<th><span id="mayorderusd"></span></th>
<th><span id="mayactusd"></span></th>
<th> </th>
<th><span id="junorderusd"></span></th>
<th><span id="junactusd"></span></th>
<th> </th>
<th><span id="julorderusd"></span></th>
<th><span id="julactusd"></span></th>
<th> </th>
<th><span id="augorderusd"></span></th>
<th><span id="augactusd"></span></th>
<th> </th>
<th><span id="seporderusd"></span></th>
<th><span id="sepactusd"></span></th>
<th> </th>
<th><span id="octorderusd"></span></th>
<th><span id="octactusd"></span></th>
<th> </th>
<th><span id="novorderusd"></span></th>
<th><span id="novactusd"></span></th>
<th> </th>
<th><span id="decorderusd"></span></th>
<th><span id="decvactusd"></span></th>
<th> </th>
<th><span id="sumorderusd"></span></th>
<th><span id="sumactusd"></span></th>
</tr>
<tr>
<th> </th>
<th>IDR</th>
<th><span id="janorderidr"></span></th>
<th><span id="janactidr"></span></th>
<th> </th>
<th><span id="feborderidr"></span></th>
<th><span id="febactidr"></span></th>
<th> </th>
<th><span id="marorderidr"></span></th>
<th><span id="maractidr"></span></th>
<th> </th>
<th><span id="aprorderidr"></span></th>
<th><span id="apractidr"></span></th>
<th> </th>
<th><span id="mayorderidr"></span></th>
<th><span id="mayactidr"></span></th>
<th> </th>
<th><span id="junorderidr"></span></th>
<th><span id="junactidr"></span></th>
<th> </th>
<th><span id="julorderidr"></span></th>
<th><span id="julactidr"></span></th>
<th> </th>
<th><span id="augorderidr"></span></th>
<th><span id="augactidr"></span></th>
<th> </th>
<th><span id="seporderidr"></span></th>
<th><span id="sepactidr"></span></th>
<th> </th>
<th><span id="octorderidr"></span></th>
<th><span id="octactidr"></span></th>
<th> </th>
<th><span id="novorderidr"></span></th>
<th><span id="novactidr"></span></th>
<th> </th>
<th><span id="decorderidr"></span></th>
<th><span id="decvactidr"></span></th>
<th> </th>
<th><span id="sumorderidr"></span></th>
<th><span id="sumactidr"></span></th>
</tr>
</tfoot>
</table>
这是我的jquery
var table = $("#tbl-cfrmvsreal");
var target = table.attr('data-table');
//console.logconsole.log(host+'konrtakkerja/'+target);
var oTable = table.on( 'processing.dt', function ( e, settings, processing ) {
if (processing) {
$(this).find('tbody').addClass('load1 csspinner');
} else{
$(this).find('tbody').removeClass('load1 csspinner');
};
} ).DataTable({
"bServerSide": true,
"ajax": host+'datatable/'+target,
"columnDefs": [{
"targets": [ -1 ],
"className": "dt-body-left",
},
{
"targets": [ 2 ],
"className": "details-control",
}],
//add by tiar 5 mei 2017
"aoColumns": [null,null,null
,null,null,null
,null,{"sClass": "alignRight"},null
,null,{"sClass": "alignRight"}],
//end
"footerCallback": function ( row, data, start, end, display ) {
// I don't know how to put these code for footer
}
});
但是我的问题是,它显示错误Uncaught TypeError: Cannot set property 'nTf' of undefined
,我知道错误的含义,但是我也需要排第二行。
我想在页脚上显示2行,第一行用于汇总货币USD,第二行用于汇总货币IDR。但是我不知道该怎么做。这些有什么解决办法吗?
编辑:没关系,我找到了另一种解决方案。那么页脚并不是最佳选择。我只是将摘要分为另一个数据表。因此,谢谢您帮助我的问题。