Datatable - custom styles for table
<p>I am using <strong>datatable</strong>. I am exporting <code>table</code> in pdf. How do I apply custom styles for <code>table</code> exported in pdf?</p>

<p>Here's my code :</p>

<pre><code>table = $(tableId).DataTable({
            dom: 'frtip',
            ajax: 'https://api.myjson.com/bins/qgcu',
            ordering: false,
            searching:false,
            buttons: [
              {
                 extend: 'collection',
                 text: 'Export',
                 buttons: [ {
                     extend: 'pdf',
                     filename : fileName,
                     title : rprtTtl,
                     orientation: "portrait",
                     pageSize : "LETTER",
                     defaultStyle: {
                         margin: 'auto',
                    },
                    customize: function (win) {
                        console.log(win);
                        $(table)
                             .css('margin', 'auto')

                        }
                 },
                 {
                     extend: 'excel',
                     filename : fileName,
                     title : rprtTtl,
                     orientation: "landscape",
                     pageSize : "A3"
                 }]
              }
           ]
        });
</code></pre>

<p>Actually in pdf my <code>table</code> is <code>aligned left</code>. I want to <code>align</code> the <code>table</code> in <code>center</code>. How do I apply custom <code>css</code> for that?</p>