Multi-functional Table To CSV Converter With jQuery - TableCSVExport

Multi-functional Table To CSV Converter With jQuery - TableCSVExport
File Size: 8.76 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Yet another jQuery based in browser html table to CSV converter that comes with lots of configuration settings.

Key features:

  • Converts html table data into a CSV file that can then be viewed in a popup window, as a data string, or downloaded as a file.
  • Allows to set the name of the downloaded file.
  • Custom separator, header and columns.
  • Allows to add extra header and data in the JavaScript.

See also:

Basic usage:

1. First you have to include the jquery.TableCSVExport.js script after loading jQuery library.

<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="jquery.TableCSVExport.js"></script>

2. Then call the plugin on the target html table.

$('#table').TableCSVExport();

3. That's it. Here's a list of default configuration options which can be passed as an object on plugin init.

$('#table').TableCSVExport({
  separator: ',',
  header: [],
  columns: [],
  extraHeader: "",
  extraData: [],
  insertBefore: "",
  delivery: 'popup' /* popup, value, download */,
  emptyValue: '',
  showHiddenRows: false,
  rowFilter: "",
  filename: "download.csv"
});

Change log:

2016-06-29

  • Now works in Safari and set utf-8 with BOM encoding

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