I use
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
the page is also UTF-8 but when I save the table it show weird caracters instead of accents also 帽 letter
Fixed with
Excel.$inject = [];
function Excel( ) {
var header = '<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8">';
return {
tableToBlob: function (tableId) {
// REQUIRE FILESAVER 1.1 GITHUB
var blob = new Blob([header + document.getElementById(tableId).innerHTML], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
});
saveAs(blob, "reporte.xls");
}
};
}
you must to use the next lines:
var header = '<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8">';
var blob = new Blob([header + document.getElementById('table2excel').innerHTML], {
type: "data:application/vnd.ms-excel;charset=UTF-8"});
saveAs(blob, nombreExcel+".xls");
Great! it was helpful for me! thanks!
Most helpful comment
you must to use the next lines: