I am able to export an HTML table using jquery if the <table>
does not have an ID or class:
But if my table has either an ID or a class attr the following jquery kicks out a string of html in one cell to excel:
$( "#clickExcel" ).click(function() {
var dtltbl = $('#dtltbl').html();
window.open('data:application/vnd.ms-excel,' + $('#dtltbl').html());
});
I can get around this by removing the tables classes and ID, but that's not ideal. Anybody have a solution?