You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I must reopen: it still happens when changing the "loading" status.
minimal code:
cell 1
importpanelaspnprint(pn.__version__)
pn.extension()
importnumpyasnpimportpandasaspdstyle_df=pd.DataFrame(np.random.randn(10, 5), columns=list('ABCDE'))
styled=pn.widgets.Tabulator(style_df, page_size=5)
defcolor_negative_red(val):
""" Takes a scalar and returns a string with the css property `'color: red'` for negative strings, black otherwise. """color='red'ifval<0else'black'return'color: %s'%colordefhighlight_max(s):
''' highlight the maximum in a Series yellow. '''is_max=s==s.max()
return ['background-color: yellow'ifvelse''forvinis_max]
styled.style.applymap(color_negative_red).apply(highlight_max)
styled
ALL software version info
panel 0.12.1 - 0.12.3
Description of expected behavior and the observed behavior
Using styling as detailed in https://panel.holoviz.org/reference/widgets/Tabulator.html#styling works when generating the table.
However it disappears due to either:
A current work around is to try to detect any changes and reapply the style. However many events are hard to detect.
This is unrelated to #2695 as I am speaking about the tabulator object itself, not the returned styled HTML from pandas.
Complete, minimal, self-contained example code that reproduces the issue
A reproducible example is in the documentation. Go to https://panel.holoviz.org/reference/widgets/Tabulator.html#styling
then resize your window. The styles disappear and all cells return to a white background and black letters.
The text was updated successfully, but these errors were encountered: