I've got a pandas DataFrame with a column that's a url, and I've written the following formatter to present it in my notebook as a link:
def make_clickable(val):
# target _blank to open new window
return '<a target="_blank" href="{}">{}</a>'.format(val, val)
all_data.style.format({'url': make_clickable})
This nicely prints out my table with the urls made clickable, but what I'd really like to do is to make this style persist as the default for that frame, so that it's used for the _repr_html
of my dataframe (and slices of it) throughout the same notebook.
Does anyone know if that's possible?
As far as I know it's not possible to register a default style. We overrode _repr_html_
instead, replacing clickable_urls
argument.
table_id=None,
render_links=render_links,
)