I think that the way to solve the problem of N, there are many combinations of use. When we use Excel to export large amounts of data, it may be from the server side, but if the amount of data is small, you can also consider using JavaScript can be lightweight export it. In addition to the actual work, the user will also consider, what you see is the resulting export of the current content to Excel table.
Here, the author has lost feelings, such as document data, file data, image data is the final analysis of some data code, and data code parsing is also more than a minute, like. html files can be opened with Notepad, browser, editing tools, and so on. Here I use Excel to open the HTML document, opportunistic a suffix is. xls oh.
JavaScript export Table Three disadvantages: 1, can only export the current page, 2, if there is a large amount of data, the JavaScript timeout crashes, 3, export data at the same time, can not do other things. Therefore, some formal, large amounts of data will not be generated through JavaScript, a little bit can oh.
On the code, the author pro-Test OH:
<! DOCTYPE html>
Demo Effect:
No debugging on all browsers Oh, I think the front-end stuff is suitable for at least three kernel browsers.
Generate Excel tables using JavaScript WYSIWYG