Dataframe type styling does not work on Tabulator when using hierarchical=True
Removing hierarchical=True and the styling works.
def color_negative_red(val):
"""
Takes a scalar and returns a string with
the css property `'color: red'` for negative
strings, green otherwise.
"""
color = '#FF0000' if val < 0 else '#03C988'
return 'color: %s' % color
df_pos_tab_info = pn.widgets.Tabulator(df_clean_pos_info, hierarchical=True,theme='midnight',hidden_columns=['index'],
layout='fit_data', disabled=True, formatters=formatters_info,
pagination='local', page_size = 20)
# not working with hierarchical=True
(df_pos_tab_info
.style
.map(color_negative_red, subset=['NetProfit'])
)
NetProfit should be green and red in the left table