Closed RaphaelRosset closed 1 month ago
I just realized that it is in fact already possible to setup a tooltip easily to any text displayed in the tabulator by passing an html string with a tooltip setup: "header/cell text" => "header/cell text"
Hi @RaphaelRosset, Could you elaborate a bit more on how to do this? (Perhaps with a bit of sample code). I am interested on doing this but cannot understand quite well what you mean.
Thx
Hi @dslemusp, Yes my answer was indeed very unclear, below is an example where second column header is modified through html. The title keyword allows to pass a tooltip string
df = pd.DataFrame(
{
"int": [1, 2, 3],
"<span style='background-color:beige;' title='Tooltip text'>header</span>": [
True,
False,
True,
],
},
index=[1, 2, 3],
)
tabulator = pn.widgets.Tabulator(df)
I second this as a requirement :)
Thirded :)
Would anyone be interested in contributing to implement this feature? I can provide guidance if needed.
Something around here: https://github.com/holoviz/panel/blob/main/panel/models/tabulator.ts#L721
Tabulator javascript handle column header tooltips: https://tabulator.info/docs/5.4/menu#tooltips
Pass a dictionary {column: tooltip_string} as optional parameter to Tabulator constructor Update the javascript columns array accordingly.
User case: limited space to display table, so using short acronyms as column headers but would like to exposed full name in tooltips.