Home >Web Front-end >HTML Tutorial >The difference between css style and class_html/css_WEB-ITnose

The difference between css style and class_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:39:411640browse

Problem description:

After clicking the [Export] button on the web page, the page table will be The content was saved as an excel file, but it was found that the table style could not be saved

Analysis process:

1. The table table uses class instead of style. The class definition is not exported when exporting. If you change to style and write the color style directly in style, the style will be exported.

Style is the style. This is used in HTML to indicate the attribute style. It is the content in css, and class is the class, which declares and defines the content. When exporting the page, the definition will not be exported, that is, the definition of class. style.

2. Put the class definition in the table and you can also export the style

Solution-:

Replace class="${getClass()}" with style= "color:${getStyle()};"

Supplementary:

$('#export').click(function () {
saveAsExcel($('h3') .text(), $('#table').html().replace(/( ) /gi,''));
});

where excel only recognizes table, When using the saveAsExcel method to automatically save, the class definition cannot be saved; if manually copied and pasted into excel, the class definition can be saved.

It is mainly a matter of manual and automatic copy and paste

Solution 2:

Will be in Just move the classes defined in

. Problem with the location of class definition styles

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn