table-exporter
Export HTML Table (Table Tag, Table CSS) to a file (JSON, CSV, etc.)
Usage
node bin/export_table tablehtml
Examples
var exporter = ; /** * exporter = function (html, tableSelector, targetSelector, callback) */ var html = `<html> <body> <table> <tr> <th>Column One</th> <th>Column Two</th> <th>Column Three</th> </tr> <tr> <td>Row 1 Col 1</td> <td>Row 1 Col 2</td> <td>Row 1 Col 3 </td> </tr> <tr> <td>Row 2 Col 1</td> <td>Row 2 Col 2</td> <td>Row 2 Col 3</td> </tr> <tr> <td>Row 3 Col 1</td> <td>Row 3 Col 2</td> <td>Row 3 Col 3</td> </tr> </table> </body> </html>` var tables = exporter; // output is an array of table that are found// for example// tables === [{"headers":["Column One","Column Two","Column Three"],"rows":[["Row 1 Col 1","Row 1 Col 2","Row 1 Col 3 "],["Row 2 Col 1","Row 2 Col 2","Row 2 Col 3"],["Row 3 Col 1","Row 3 Col 2","Row 3 Col 3"]]}]
Use in a brower
Install Browserify
npm install --global browserify
Produce Table Exporter Javascript Bundle
browserify webjs -o web/tejs