hhurz / tableExport.jquery.plugin

jQuery plugin to export a html table to JSON, XML, CSV, TSV, TXT, SQL, Word, Excel, PNG and PDF
MIT License
984 stars 714 forks source link

Export to Excel (xlsx) without styles #338

Closed MiaHuangMia closed 2 years ago

MiaHuangMia commented 2 years ago

if I Export type is "excel",it's works fine, but if type is "xlsx",styles are not works. Following is my code,

$("table").tableExport({ type: "xlsx", //"excel" is works fine escape: "false", mso: { styles:['background-color', 'border-top-color', 'border-left-color', 'border-right-color', 'border-bottom-color', 'border-top-width', 'border-left-width', 'border-right-width', 'border-bottom-width', 'border-top-style', 'border-left-style', 'border-right-style', 'border-bottom-style', 'color'] } });

Naruto-kyun commented 2 years ago

This is state in documentation: The mso.styles option lets you define the css attributes of the original html table cells, that should be taken over when exporting to an excel worksheet (Excel 2000 html format only).