Я хочу добавить некоторые данные в div при экспорте с помощью datatable pdf button.
Как добавить div при экспорте в pdf?
и я хочу спросить, почему мой первый заголовок строки появляется при экспорте
это мой скрипт для датированных
$(document).ready(function() {
$('#globaldatatable').DataTable({
scrollX: '100%',
scrollY: 400,
iDisplayLength: '100',
ordering: false,
bPaginate: false,
sDom: '<"row"<"col-sm-6"B><"col-sm-6">>' + '<"row"<"col-sm-12"<"table-responsive"t>>>' + '<"row"<"col-sm-5"><"col-sm-7">>',
buttons: {
buttons: [
{ extend: 'pdfHtml5',
text: '<i class="fa fa-file-pdf-o"></i> PDF',
className: 'excelButton',
orientation: 'landscape',
title: 'Laporan Detail Karyawan',
pageSize: 'A4'
},
{ extend: 'excelHtml5',
text: '<i class="fa fa-file-excel-o"></i> EXCEL',
className: 'excelButton',
title: 'Laporan Detail Karyawan',
message: $('#printed').text()
}],
dom: {
container: {
className: 'dt-buttons'
},
button: {
className: 'btn btn-default'
}
}
},
"columnDefs": [ { "width": "5%", "targets": 0 } ]
});
});
это моя thead, и первая строка здесь появляется, когда я ее экспортирую.
<thead>
<tr>
<th colspan="3">
<th colspan="2" style="text-align: center;">Saldo Awal</th>
<th colspan="2" style="text-align: center;">Terima</th>
<th>Rata</th>
<th colspan="2" style="text-align: center;">Keluar</th>
<th colspan="2" style="text-align: center;">Saldo Akhir</th>
</tr>
<tr>
<th>Kode Brg</th>
<th>Nama Brg</th>
<th>Satuan</th>
<th>Qty</th>
<th>Nominal</th>
<th>Qty</th>
<th>Nominal</th>
<th>Rata</th>
<th>Qty</th>
<th>Nominal</th>
<th>Qty</th>
<th>Nominal</th>
</tr>
</thead>
этот дест появляется, когда я его печатаю
<tr>
<th colspan="3">
<th colspan="2" style="text-align: center;">Saldo Awal</th>
<th colspan="2" style="text-align: center;">Terima</th>
<th>Rata</th>
<th colspan="2" style="text-align: center;">Keluar</th>
<th colspan="2" style="text-align: center;">Saldo Akhir</th>
</tr>
пожалуйста, помогите