Problem Description:
Web page Click the "Export" button, save the page table content into an Excel file, but found that the table style cannot be saved
Analysis Process:
The 1.table table uses class instead of style. The class definition is not exported and the style is exported by writing the color style directly in the style if you change to a style.
Style is a pattern, which is used in HTML to mark the attribute style, is the content of the CSS , and the class is the content of the contents of the category, Declaration and definition, when exporting the page does not export the definition of the style defined by class.
2. You can also export a style by placing the class definition in the table
WORKAROUND-:
Replace class= "${getclass ()}" with Style= "Color:${getstyle ()};"
Add:
$ (' #export '). Click (function () {
Saveasexcel ($ (' H3 '). Text (), $ (' #table '). html (). Replace (/( ) +/gi, "));
});
Where Excel recognizes only table, the class definition is not saved when you save automatically using the Saveasexcel method, and the class definition can be saved if you copy and paste it to excel manually.
Mainly manual and automatic copy pasting problem
Workaround Two:
Move the classes defined in
The difference between CSS style and class