R
R
ravshan selimov2021-04-01 08:51:32
JavaScript
ravshan selimov, 2021-04-01 08:51:32

How to export html table to excel without warnings?

Hello.
Need to export html table to excel.

To do this, I use a simple link, where href="`data:application/vnd.ms-excel,${tableHtml}`"
tableHtml - html string representation of the table =

this.tableHtml = this.$refs.table.outerHTML.replace(/ /g, '%20');


Everything works, only when opening this excel file they give the following.
60655edad953e255732870.png

I tried several different libraries, nothing helps.
There is only a working sheet.js, but in the free version it does not save formatting and styles.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
1
12rbah, 2021-04-01
@12rbah

It is advisable to look at the file that you are saving. Alternatively, try changing xls to xlsx, because they are different formats. Well, this question has already been asked.
How to fix "xls file format does not match file permission" error?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question