Difference between css style and class, cssclass

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.