I am creating a table in python using pretty-table and trying to have one column which are the urls have clickable links:
Eg:
filepath = "pretty_table.html"
from prettytable import PrettyTable
x = PrettyTable()
x.format = True
x = PrettyTable(["City name", "Area", "Url"])
x.add_row(["Adelaide",1295, "<a href='https://en.wikipedia.org/wiki/Adelaide'>https://en.wikipedia.org/wiki/Adelaide</a>" ])
x.add_row(["Brisbane",5905, "<a href='https://en.wikipedia.org/wiki/Brisbane'>https://en.wikipedia.org/wiki/Brisbane</a>"])
result = []
result.append(x.get_html_string())
with open(filepath, 'w') as f:
for line in result:
f.write("{}\n".format(line))
However, with the above, the table doesn't generate clickable links for the wiki pages. Can someone please help.