JSFiddle - React, Tailwind, and code Playground

HTML

<script src="//unpkg.com/xlsx/dist/xlsx.full.min.js"></script>
<table id="sampletable" class="uk-report-table table table-striped">
                        <thead>
                            <tr>
                                <th colspan="1">Date Range</th>
                                <th colspan="5">
                                    <h2>Last 30 Days</h2>
                                </th>
                                <th colspan="5">
                                    <h2>Previous 30 Days</h2>
                                </th>
                            </tr>
                            <tr>
                                <th>A</th>
                                <th>B</th>
                                <th>C</th>
                                <th>D</th>
                                <th>E</th>
                                <th>A2</th>
                                <th>B2</th>
                                <th>C2</th>
                                <th>D2</th>
                                <th>E2</th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                   <button onclick="exportFile()">
                   Export
                   </button>
                   </button>

JavaScript

function exportFile(){
  var wb = XLSX.utils.table_to_book(document.getElementById('sampletable'));
  XLSX.writeFile(wb, 'sample.xlsx');

}