JSFiddle - React, Tailwind, and code Playground
HTML
<button id="clickExcel">Download As Excell</button>
<div id="dtltbl">
<table>
<tr>
<td>Here</td>
<td>Is</td>
<td>Data</td>
</tr>
<tr>
<td>Here</td>
<td>Is</td>
<td>More</td>
</tr>
</table>
</div>
JavaScript
$( "#clickExcel" ).click(function() {
var dtltbl = $('#dtltbl').html();
window.open('data:application/vnd.ms-excel,' + encodeURIComponent($('#dtltbl').html()));
});