export-table-to-csv

Export a html table to csv using javascript


Keywords
csv, javascript, excel, table, html, to
License
MIT
Install
bower install export-table-to-csv

Documentation

Export table to CSV -


## Example

<table id="export-table">
    <thead>
        <tr>
            <td>Head</td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>A</td>
        </tr>
        <tr>
            <!-- export replace: replace the value -->
            <td data-export-replace="$">B $</td>
        </tr>
        <tr>
            <td>C</td>
        </tr>
    </tbody>
</table>   

```javascript    
    <script>

        $(function () {

            exportTableToCsv.init($('#export-table'), 'csv-name.csv');

        });

    </script>