title: Export Data to excel file from datatable using js or jquery
body: <p>I am trying to export data to excel file using javascipt or jquery.
  The problem is with getting the headers and duplicates records.Following are the scenarios-</p>
  
  <p>1)</p>
  
  <pre><code>var otable = $('#plExcelReport').DataTable();
  
  $('&lt;table&gt;').append(otable.$('tr').clone()).table2excel({
                  // exclude CSS class
                  exclude: ".noExl",
                  name: "Worksheet Name",
                  filename: xcelFileName
              });
  </code></pre>
  
  <p>All data from data table gets exported to excel file except headers.</p>
  
  <p>2)</p>
  
  <pre><code>var otable = $('#plExcelReport').DataTable();
  
  $('#plExcelReport').append(otable.$('tr').clone()).table2excel({
                  // exclude CSS class
                  exclude: ".noExl",
                  name: "Worksheet Name",
                  filename: xcelFileName
              });
  </code></pre>
  
  <p>Header appear but data from first page gets duplicated in excel file </p>
  
  <p>I want to achieve both things i.e header and non-duplicate records ,please help</p>