Even using pure pandas doing what you’re doing there has zero effect. df.style.format returns a new object, it does not modify the dataframe inplace (that only works on Tabulator).
We should support pandas Styler objects so you can do:
Another solution would be to create an improved DataFrameX pane.
from html import escape
import panel as pn
import pandas as pd
import param
pn.extension(sizing_mode="stretch_width")
# The urls depend on which row and column they are in
df = pd.DataFrame({
"country": ["DK", "DE"],
"1": ["<a href='https://www.google.com?country=DK&day=1' target='_blank'>1</a>", "<a href='?country=DE&day=1'>2</a>"],
"2": ["<a href='?country=DK&day=2'>3</a>", "<a href='?country=DE&day=2'>4</a>"]
})
class DataFrameX(pn.pane.DataFrame):
escape = param.Boolean(default=True)
_rerender_params = [*pn.pane.DataFrame._rerender_params, "escape"]
table = DataFrameX(df, escape=False)
pn.Column(table).servable()
As far as I can see @philippjfr. The styler does not support adding links that depend on the row and column they are in. The escape parameter needs to be added to the DataFrame pane to support links.