The column names of my editable datatable are dates in this string format:
"%b%y"
I want all the cells of the historical columns to be shaded in light grey. The documentation here presents plenty of applications and examples, but none of them deals with the column names. Can it be done? I suspect it’s doable but I need help. My incomplete attempt:
dash.dash_table.DataTable(
id="table",
editable=True,
row_selectable="multi",
css=[{"selector": "table", "rule": "margin-bottom: 50px;"}],
style_data={"width": "20px", "maxWidth": "20px", "minWidth": "20px"},
style_cell_conditional=[
{
"if": {"column_id": "state"},
"width": "150px",
"textAlign": "left",
}
],
style_data_conditional=[
{
"if":{
"I do not know what goes in here"
},
"backgroundColor": "lightgrey",
}
]
),
For reference, the data looks like this:
pd.DataFrame(columns=['state', 'Sep24', 'Oct24', 'Nov24', 'Dec24', 'Jan24', 'Feb24', 'Mar24',] , data=[['TX',1,2,3,4,5,6,7],['AK',7,6,5,4,3,2,1],['LA',2,4,6,8,10,12,14]])
Please is anyone able to help me out with that if statement?