I’ve a below code in which I show dataframe data in Tabulator. I would like to add hyperlinks in this tabulator without mentioning whole website. Any idea how to do that?
import panel as pn
import param
import pandas as pd
pn.extension('tabulator')
class Example(param.Parameterized):
df = param.DataFrame()
def show_data():
ex_obj = Example()
data_list = [{'sr': 1, 'name': 'Stephen', 'Website': '<a href="https://www.google.com">Google</a>'},
{'sr': 2, 'name': 'Alex', 'Website': '<a href="https://www.facebook.com">Facebook</a>'}]
ex_obj.df = pd.DataFrame(data_list)
gspec = pn.GridSpec(sizing_mode='stretch_both', max_height=200)
data_table = pn.widgets.Tabulator.from_param(ex_obj.param.df, pagination="remote", disabled=True, render_links=True)
gspec[0:2, :3] = data_table
tabs = pn.Tabs(('Analytics', gspec))
return tabs
def show(page):
tabs = show_data()
return tabs
page = pn.widgets.RadioButtonGroup(
value='First Page',
options=['First Page', 'Second Page'],
name="Page",
button_type="success",
orientation="vertical")
ishow = pn.bind(show, page=page)
pn.template.FastListTemplate(
title="Data Analytics",
sidebar=[page],
main=[ishow]).servable()
It looks like below in browser