html-table-to-csv
v1.0.3
Published
This NPM package exports a CSV string from an HTML table. The function takes one parameter tableId which is a string representing the id of the table in the HTML document.
Downloads
38
Maintainers
Readme
<button onclick="htmlTableToCsv('my-table', 'table-data')">Download as CSV</button>
<tr>
<td>Column 1, Row 1</td>
<td>Column 2, Row 1</td>
</tr>
<tr>
<td>Column 1, Row 2</td>
<td>Column 2, Row 2</td>
</tr>
</table>
console.log(csvString);
Column 1, Row 2,Column 2, Row 2