JSFiddle - React, Tailwind, and code Playground
HTML
<table id="data">
<tr>
<td>1</td>
<td>Test</td>
</tr>
</table>
JavaScript
var test = $('#data');
window.open('data:application/vnd.ms-excel,' + encodeURIComponent(test[0].outerHTML));