Convert HTML Table To CSV – table2csv

Category: Javascript , Table | October 9, 2020
AuthorYunisDEV
Last UpdateOctober 9, 2020
LicenseMIT
Views1,729 views
Convert HTML Table To CSV – table2csv

table2csv is a vanilla JavaScript Table To CSV converter that reads and saves tabular data as a CSV file for further use.

See Also:

How to use it:

1. Insert the table2csv.min.js file into the HTML page.

<script src="table2csv.min.js"></script>

2. Assign a unique ID to your HTML table.

<table id="example">
  ...
</table>

3. Create a converter button and determine the selector of the target HTML table using the data-table attribute:

<button onclick="table2csv(this,1)" 
        data-table="example">
        Download The Table
</button>

You Might Be Interested In:


Leave a Reply