title: How do I export data from jquery datatable in laravel 5.3?
body: <p>I would want to export data from jquery datatables to PDF and CSV formats. I am following this <a href="https://datatables.net/extensions/buttons/examples/initialisation/export.html" rel="nofollow">https://datatables.net/extensions/buttons/examples/initialisation/export.html</a> however I am unable to insert </p>
  
  <pre><code>$(document).ready(function(){
      $('#payments-table').DataTable({
          dom: 'Bfrtip',
          buttons: [
              'copy', 'csv', 'excel', 'pdf', 'print'
          ]
      });
  }); 
  </code></pre>
  
  <p>properly to my working code.</p>
  
  <pre><code>&lt;script&gt;
      $(function() {
          $('#payments-table').DataTable({
              processing: true,
              serverSide: true,
              scrollX: true,
  
              ajax: '{!! route('
              HomeControllerPaymentsData ') !!}',
              columns: [{
                  data: 'id',
                  name: 'id'
              }, {
                  data: 'name',
                  name: 'name'
              }, {
                  data: 'amount',
                  name: 'amount'
              }, {
                  data: 'trans_id',
                  name: 'trans_id'
              }, {
                  data: 'msisdn',
                  name: 'msisdn'
              }, {
                  data: 'time_paid',
                  name: 'time_paid'
              }, {
                  data: 'account',
                  name: 'account'
              }, {
                  data: 'orgaccountbalance',
                  name: 'orgaccountbalance'
              }]
  
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Kindly would someone help me to combine the two scripts to have the buttons appear? Thank you.</p>