0

Im trying to export the data i have into an excel file without jquery. I've read you can use javascript but most example have jquery. The reason i don't want to use jquery is that the project is build with react.

I already have the data from the database, so i don't need to bring it again. I want to take that data and make it into an excel file. little bit of the code below.

<li className='col-md-3 col-height col-middle'>
<span>{fromTime}</span> //contains data
</li>

Some example use table, is it possible to export from

<div>
<li>
<span>

Would appreciate any tips, example or anything

Gildarian
  • 41
  • 3

2 Answers2

0

The most common way to export data into excel would be to covert it into a csv (comma seperated values) file which can then be opened in excel. There are plenty of tutorials on how to do this, there are many different ways with a simple google. In your case doing this in php will likely be best because your getting it from a database.

JohnB
  • 808
  • 6
  • 12
0

SheetJS seems perfect for this.

To export your table as an excel file use the code in this link(along with SheetJS)

Just plug in your table element's id into export_table_to_excel