Skip to content

yunisdev/table2csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Installation

Add following HTML before body end:

<script src="https://yunisdev.github.io/table2csv/table2csv.min.js"></script>
<!-- or -->
<script src="https://unpkg.com/yunisdev-table2csv"></script>

or you can install using npm:

npm i yunisdev-table2csv

Usage

You can use this library using following syntax:

<button class="table-btn" onclick="table2csv(this,1)" data-table="usersTable">Download</button>
  • data-table is id of table to convert.
  • table2csv is function that converts table in id of data-table to csv file and downloads. Accepts 2 parameters:
    • el. Required. Accepts object of button.
    • endcut. Optional. Accept an integer to cut from end of table.