Convert Excel spreadseet to HTML, retail hyperlinks in cells
Convert Excel spreadseet to HTML, retail hyperlinks in cells
I am looking to convert a spreadsheet into HTML table, for use in datatables on my website. My current issue is that most Excel to HTML tools do not keep hyperlinks in cells.
For example, say I have an Excel sheet with the word 'Google' in a cell, which contains a hyperlink to 'www.google.com'.
When using common online tools to convert Excel table to HTML table, it would output the cell like this:
<td>Google</td>
What I am ideally hoping for instead is this:
<td><a href="www.google.com" target="_blank">Google</a></td>
Notes:
1) I am currently using the VBA script from this page to convert Excel data into HTML format: https://gist.github.com/shapiromatron/5024948?permalink_comment_id=2985716
2) Another example conversion tool is this: https://tools.agsci.psu.edu/table-maker/
3) I am not committed to any method. Currently using Excel, but happy to use Google Sheets (or other) if easier,
4) I'm also happy to not use spreadsheets at all, however, I'll be regularly updating the data and creating a lot of tables, so figured spreadsheets were the easiest source to maintain?!
Many thanks in advance for any guidance or tips you may have
Answers
I'm not familiar with any tools to convert a spreadsheet to HTML. since the question is not specific to Datatables you might be better off asking on a forum like Stack Overflow. You might also ask the developers of the tools you are trying to see if there are options to export the hyperlink.
Kevin
Thank you for your response, @kthorngren. I have now also posted on Stack Overflow.
I thought it worth posting here, just in case any datatables users had any experience in managing spreadsheets/databases/tables which included hyperlinks. Very much appreciate any advice from anyone if so
This thread might help - it's using papaparse to parse the CSV. You might be able to tweak it to read the XLS doc format instead.
Colin
I used SheetJS in CloudTables to read XLSX files for import there. Its an excellent library and will probably do a large part of what you want.
Allan