How I can use columnDefs and buttons for print?

How I can use columnDefs and buttons for print?

saleemmssaleemms Posts: 5Questions: 3Answers: 0

Hi All,

I want to remove sorting from all columns in the table and want to add a print button on top.

But when I am using below code the print button is missing:

$('#printData').DataTable({
      dom: 'Bfrtip',
      "paging": false,
      "iDisplayLength": -1,
      buttons: [{               
                    extend: 'print', footer: true,
                    title:'<div style="text-align:center;"><h1>Keer Industries</h2></div><div style="text-align:center;font-size:15px;"><br />Krisi Mandi ke piche<br /><br />Bilara<br /><br /></div>'
                }],
      columnDefs: [{   
            "visible": true,
            "searchable": true
        }],         
    });

Please let us know I can use both?

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.