Exporting HTML Table Into CSV File - jQuery csvExport

Exporting HTML Table Into CSV File - jQuery csvExport
File Size: 4.91 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Yet another jQuery Table To CSV plugin that converts any tabular data into comma separated values that can then be downloaded as a CSV file.

How to use it:

1. Download and insert the 'csvExport.js' file after jQuery JavaScript library.

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="csvExport.js"></script>

2. Call the plugin on the target html table and you're done.

$('table').csvExport();

3. By default, the plugin will automatically escape illegal chars when exporting.

$('table').csvExport({
  escapeContent:true
});

4. Customize the CSV file name:

$('table').csvExport({
  title:'Exported_Table'
});

5. Callback functions.

$('table').csvExport({

  // before start
  beforeStart : function(none, table) {},

  // when CSV string is ready
  onStringReady : function(none, currentString) {}
  
});

Change log:

2018-05-21

  • rewritten in ES6

This awesome jQuery plugin is developed by Zenoo. For more Advanced Usages, please check the demo page or visit the official website.