Hello,
When you create a hyperlink in Excel, it has its own specific way of generating and rendering them inside the spreadsheet. However, our plugin can only render links as custom HTML.
In this case, you would need to re-format your link cell values. We recommend the following.
You can display links/hyperlinks in wpDataTables cells in a few different ways:
It depends if you have one link per cell, or if you have multiple links in the same cell.
- If you have one link per cell, perhaps the simplest way is to use our URL Columns.
They have specific rendering rules :
Rendering rules: If the content of the cells contains a combination of “two sticks” – || – everything to the left of this combination is used as an URL address for the link, and everything to the right as displayed text. For example:
https://wpdatatables.com||Check out wpDataTables
will be rendered as: Check out wpDataTables
If the “||” combination is not found in the content, the entire content will be used both for the link and as the display value. For example: https://wpdatatables.com will be rendered as: https://wpdatatables.com
2. Alternatively, you can use String Columns.
They can render custom HTML, in that case, you would have to wrap the links in the source data as HTML anchor tags, for example :
<a href="https://www.w3schools.com">Visit W3Schools.com!</a>
will be rendered as hyperlink of displayed text : ” Visit W3Schools.com! “
if you use String Columns, you will also be able to have multiple links in the same cell, and combinations or images with links, etc ( if needed).
3. There is another way with our Transform Value feature to make custom links.
You could separate the data for the hyperlink into two columns.
– One column for the ‘URL link itself’
– And another column to store the ‘displayed text’ for the hyperlink.
Then, with our Transform value feature – you can use a String Column in our Table and create a dynamic custom HTML a href tag and inside it, you can call these column placeholders.
( Optionally you can of course add ‘target blank attribute’ to open the link in new tab)
For example, let’s say we called the URL column just “URL” and the other Column “displayed text”.
Then, the Transform Value would be something like this :
<a href="{URL.value}" target="_blank">{displayed text.value}</a>
Then the String Column in which you used this is going to render each row to pull the values from the respective column placeholders.
You can check out the Documentation Page i sent above to see more detailed examples how you can use the Transform Value feature.
I hope that helps.
Kind regards,
Milos