Missing Header data after DataTables Excel Export
<p>I'm looking to have export functionality on a webpage using datatables.
My table structure is as follows:</p>

<pre><code>&lt;table id="data-table" class="display table" width="100%"&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th colspan="4" class="center-align solid-left-border" style="border-bottom: none; text-decoration: underline; text-transform: uppercase; padding: 5px 18px;"&gt;
        Tier 2 Contributions Report
      &lt;/th&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;th class="left-align solid-left-border" style="border-bottom: none; text-decoration: none; text-transform: uppercase; font-weight: normal; font-weight: normal; padding: 5px 18px; font-size: 12.5px"&gt;
        Employer's FIle No/Registration No:
      &lt;/th&gt;

      &lt;th colspan="3" class="left-align solid-left-border" style="border-bottom: none; font-weight: normal; padding: 5px 18px; font-size: 12.5px; text-transform: uppercase;"&gt;
        &lt;%= company.getSSNITRegistration() || '-' %&gt;
      &lt;/th&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;th class="left-align solid-left-border" style="border-bottom: none; text-decoration: none; text-transform: uppercase; font-weight: normal; padding: 5px 18px; font-size: 12.5px;"&gt;
        Name of Employer:
      &lt;/th&gt;

      &lt;th colspan="3" class="left-align solid-left-border" style="border-bottom: none; font-weight: normal; padding: 5px 18px; font-size: 12.5px; text-transform: uppercase;"&gt;
        &lt;%= company.getName() || '-' %&gt;
      &lt;/th&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;th class="left-align solid-left-border" style="border-bottom: none; text-decoration: none; text-transform: uppercase; font-weight: normal; padding: 5px 18px; font-size: 12.5px;"&gt;
        Address of Employer:
      &lt;/th&gt;

      &lt;th colspan="3" class="left-align solid-left-border" style="border-bottom: none; font-weight: normal; padding: 5px 18px; font-size: 12.5px; text-transform: uppercase;"&gt;
        &lt;%= company.getAddress() || '-' %&gt;
      &lt;/th&gt;
    &lt;/tr&gt;


    &lt;tr&gt;
      &lt;th colspan="4" style="border-bottom: none;"&gt;&lt;/th&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;th class="left-align"&gt;Social Sec. No.&lt;/th&gt;
      &lt;th class="left-align"&gt;Full Name&lt;/th&gt;
      &lt;th class="center-align"&gt;Basic Salary&lt;/th&gt;
      &lt;th class="right-align"&gt;Contribution (5%)&lt;/th&gt;
    &lt;/tr&gt;

  &lt;/thead&gt;

  &lt;tfoot&gt;
   &lt;tr&gt;
     &lt;th colspan="2" class="left-align"&gt;Totals&lt;/th&gt;
     &lt;th class="center-align"&gt;&lt;%= addCommas(totals.basicSalary) %&gt;&lt;/th&gt;
     &lt;th class="right-align"&gt;&lt;%= addCommas(totals.contribution) %&gt;&lt;/th&gt;
   &lt;/tr&gt;
  &lt;/tfoot&gt;

  &lt;tbody&gt;   
    &lt;% employees.forEach(function(employee) { %&gt;
      &lt;tr&gt;
        &lt;td class="left-align"&gt;&lt;%= employee.ssnitNumber %&gt;&lt;/td&gt;
        &lt;td class="left-align"&gt;&lt;%= employee.lastName + ', ' + employee.firstName + ' ' + employee.otherNames%&gt;&lt;/td&gt;
        &lt;td class="center-align"&gt;&lt;%= addCommas(employee.basicSalary) %&gt;&lt;/td&gt;
        &lt;td class="right-align"&gt;&lt;%= addCommas(employee.contribution) %&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;% }) %&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
</code></pre>

<p>and js:</p>

<pre><code>$('#data-table').DataTable( {
  "bPaginate": true,
  "bLengthChange": true,
  "bFilter": true,
  "bSort": false,
  "bInfo": true,
  "bAutoWidth": false,
  "dom": 'Bfrtip',
  "buttons": [
    'copy', 'csv', 'excel', 'pdf', 'print'
  ]

});
</code></pre>

<p>Though exports work, for some reason only the last part of the header gets exported:</p>

<pre><code>    &lt;tr&gt;
      &lt;th class="left-align"&gt;Social Sec. No.&lt;/th&gt;
      &lt;th class="left-align"&gt;Full Name&lt;/th&gt;
      &lt;th class="center-align"&gt;Basic Salary&lt;/th&gt;
      &lt;th class="right-align"&gt;Contribution (5%)&lt;/th&gt;
    &lt;/tr&gt;
</code></pre>

<p>I've tried playing around with exportOptions, but not much luck there, and moreover, headers are exported by default.</p>

<p>I'd appreciate any help, thanks :)</p>