Convert Excel spreadseet to HTML, retail hyperlinks in cells

Convert Excel spreadseet to HTML, retail hyperlinks in cells

JJ_JJ_ Posts: 2Questions: 1Answers: 0
edited July 2023 in Free community support

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

  • kthorngrenkthorngren Posts: 21,125Questions: 26Answers: 4,916
    edited July 2023

    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

  • JJ_JJ_ Posts: 2Questions: 1Answers: 0

    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 :smile:

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    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

  • allanallan Posts: 63,113Questions: 1Answers: 10,397 Site admin

    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

Sign In or Register to comment.