JSFiddle - React, Tailwind, and code Playground
HTML
<table>
<tr>
<td>
Hello
</td>
</tr>
<tr>
<td>
hello
</td>
<td>
hi
</td>
</tr>
</table>
JavaScript
var ExcelApp = new ActiveXObject("Excel.Application");
var ExcelSheet = new ActiveXObject("Excel.Sheet");
ExcelSheet.Application.Visible = true;
$('th, td').each(function(i){
ExcelSheet.ActiveSheet.Cells(i+1,i+1).Value = this.innerHTML;
});