Difference between css style and class, cssclass
Problem description:
After clicking the export button on the webpage, the table content on the page is saved as an excel file, but the table style cannot be saved.
Analysis process:
1. Use a class instead of a style in a table. The class definition is not exported during export. If you change to style, you can write the Color style directly in the style to export the style.
Style is a style. This is used in HTML to indicate the attribute style. It is the content in css, while class is the content in class, declaration and definition, the style defined by class is not exported when the page is exported.
2. Place the class definition in the table and export the style.
Solution -:
Change class = "$ {getClass ()}" to style = "color :$ {getStyle ()};"
Supplement:
$ ('# Export'). click (function (){
SaveAsExcel ($ ('h3 '). text (), ('your table'your .html (). replace (/(& nbsp;) +/gi ,''));
});
Excel only recognizes tables. When the saveAsExcel method is used for automatic saving, the class definition cannot be saved. If you copy and paste it to excel manually, the class definition can be saved.
It is mainly about manual and automatic copy and paste.
Solution 2:
Move the class defined in