Export a table to PDF without a specific column

Export a table to PDF without a specific column

Hamster69Hamster69 Posts: 4Questions: 2Answers: 0

Hi my code is;
$(document).ready( function () {
currentTable = $('#example').DataTable( {
dom: 'Bfrtip',
buttons: [{
extend: 'pdfHtml5',
}]
});
});
currentTable.column( 1 ).visible( allDeviceSelected );
when I export it, the column 1 appear in the pdf.
How can I export the table without that specific column?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,891Questions: 1Answers: 10,143 Site admin
    Answer ✓

    You need to use the columns option of the exportOptions to control which columns are included in the export. There is an example of that here.

    Allan

  • Hamster69Hamster69 Posts: 4Questions: 2Answers: 0

    It works.
    thanks allan

This discussion has been closed.