Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dstuecken/exporttableascsv

Prototype JS Extension to export an HTML table as CSV
https://github.com/dstuecken/exporttableascsv

Last synced: 13 days ago
JSON representation

Prototype JS Extension to export an HTML table as CSV

Awesome Lists containing this project

README

        

## exportTableAsCSV
================

This is a Prototype (http://prototypejs.org/) extension to export an HTML table as CSV and directly sends it to the browser.

## Usage

The usage is pretty simple as it extends the Element Object by one method: exportTableAsCSV

```js
$('table-id').exportTableAsCSV();
```

```js
$('table-id').exportTableAsCSV({
header: [
'my', 'custom', 'header', 'instead', 'of', 'the', 'regular', 'th', 'header'
]
});
```

```js
$('table-id').exportTableAsCSV({
separator: ';' // use ; instead of , for separating
});
```