Export HTML table to CSV file
Imagine you have an HTML table, for example something like this: <table> <tr><th>Name</th><th>Age</th><th>Country</th></tr> <tr><td>Geronimo</td><td>26</td><td>France</td></tr> <tr><td>Natalia</td><td>19</td><td>Spain</td></tr> <tr><td>Silvia</td><td>32</td><td>Russia</td></tr> </table> And you want to download it as a CSV table format. First of all, you need to transform from HTML to CSV. var csv = []; var rows = document.querySelectorAll(“table tr”); for (var i = 0; i < […]