stephen-hardy / xlsx.js

XLSX.js is a JavaScript library for converting the data in base64 XLSX files into JavaScript objects - and back! Please note that this library is licensed under the Microsoft Office Extensible File License - a license NOT approved by the OSI. While this license is based off of the MS-PL, which is OSI-approved, there are significant differences.
http://blog.innovatejs.com/?tag=xlsx-js
Other
575 stars 122 forks source link

Export example code for 2.2.0? #12

Open jacobsjensen opened 11 years ago

jacobsjensen commented 11 years ago

Hi guys,

First of all, great job!

I'm currently using the old version (1.0) which creates semi-corrupt excel output from my html table (It opens correctly after Excel repairs the file). I can't seem to find the error in my table markup, but if I replace the markup inside my table to match your jsfiddle example markup, it exports correctly. I was hoping that using the new 2.2.0 would solve it, but I can't find out a way to tweak the existing export code to match 2.2.0 requirements.

Can you please supply a modified export example matching the 2.2.0 requirements?

Thanks in advance! :-)

DLDante commented 10 years ago

HI, yes great job!, I am on the same situation, I need the example fiddle http://jsfiddle.net/innovatejs/ueETX/ but run with the new library, please stephen can you communicate with me?

joe4mg commented 10 years ago

I was having trouble getting an example to work too but this is now working nicely: http://jsfiddle.net/graemegeorge/V53HR/

junjimalaza commented 10 years ago

The example here http://jsfiddle.net/graemegeorge/V53HR/ does not really solve our issue as with jacobsjensen is trying to point out.

How do you pass the data from a HTML Table to xlsx?

joe4mg commented 10 years ago

Here you are http://jsfiddle.net/joe4mg/hvjEM/1/ - the data you need to pass to this version of xlsx.js is just in a slightly different format

junjimalaza commented 10 years ago

Thanks joe4mg is it also possible to maintain the table format like the bold and the background colors plus the table borders. Just like the old xls versions, maybe this would be a good example http://fiddle.jshell.net/cmewv/537/

tbenbrahim commented 10 years ago

I have a fork that supports font and background color (among other things), and borders are already supported, so you should be able to accomplish this. https://github.com/tbenbrahim/xlsx.js

junjimalaza commented 10 years ago

I'll have a look thanks

junjimalaza commented 10 years ago

How do you point to a specific cell, the data that I have is loaded from the static HTML Table