I have simple table with href inside the text. The href points to relative path of local html file. But clicking on it doesn't open the page. is there any way to do that/ good workaround?
The folder structure is following. As the root will be changed, so the relative path is needed.
--root
--root/index.html
--root/files/file1.html
--root/files/file2.html
import plotly.express as px
df = px.data.gapminder().query("year == 2007")
link_ref = '<a href="files/file1.html">{}</a>'
df['country'] = df['country'].apply(lambda item: link_ref.format(item))
fig = px.treemap(df, path=[ 'continent', 'country'], values='pop',
color='lifeExp', hover_data=['iso_alpha'])
fig.write_html("index.html")
Note: The link starting with http
works. Plotly: treemap element with "href" not working
link_ref = '<a href="http://google.com">{}</a>'
Update:
The following link partially works.
link_ref = '<a href="http:///files/file1.html">{}</a>'