@Philippe thanks for clarifying that pandas styling doesnt currently work with the new DataTable.
Is there currently a “Dash” way to replicate a similar styling approach in the code below for the new datatable? This example is a simple dummy-dataset, but this approach was used on a large dataframe in a jupyterlab, so it would be helpful to know how to replicate in Dash.
df = pd.DataFrame({'Freshman':['Mike', 'Bill', 'Maria'],
'Junior':['Lauren','Tom','Jessica'],
'Senior':['Sandy','Michelle','Mike']
})
my_dict = {'Male':['Mike','Bill','Tom'],
'Female':['Maria','Lauren','Jessica','Sandy','Michelle']}
def where(val):
bg = ['blue', 'pink']
fg = ['orange', 'red']
ls = ['Male', 'Female']
for i, y in enumerate(ls):
if val in my_dict[y]:
return f"background-color: {bg[i]}; color: {fg[i]}"
return ''
df = df.style.applymap(where)
@eliasdabbas this question may be of interest to you