Hi, I have been facing a similar issue regarding changing the text-color of my dropdown options in dash datatable.
I was unable to use the solution proposed here. So I was wondering if it is possible to change the text-color property by including some lines of code in the ‘css’ property of DataTable.
This is my current table structure:
tuning_options = ['grid-search','random-search','bayes-search']
dash_table.DataTable(id='model-selection-table',data=model_select_df.to_dict("records"),
columns=[{"name": i, "id": i,"presentation":'dropdown','editable':True} if i =='Hyperparameter Tuning Method' else {"name": i, "id": i} for i in model_select_df.columns
]
,row_selectable="multi",
selected_rows=[],
dropdown = {
'Hyperparameter Tuning Method': {
'options': [
{'label': i, 'value': i}
for i in tuning_options
],
},
},
style_data={
'backgroundColor': 'rgb(50, 50, 50)',
'color': 'white'
},
style_filter={
'color': 'white'
},
style_table={
'overflowY': 'scroll',
'maxHeight': '700px',
'color':'white',
'font-size':25},
style_header={
'backgroundColor': 'rgb(30, 30, 30)',
'color': 'white',
'font-size':25
},css=[ {"selector": ".Select-menu-outer", "rule": 'display : block !important'},
],style_data_conditional=[{'if':{'column_id':'Hyperparameter Tuning Method'},
'color':'white'}],
)
The column named "Hyperparameter Tuning Method’ is a column with dropdowns whose text color i would like to change.
this is what my table looks like:
I was thinking if implementing something like this and adding it to the css parameter would work or not:
{“selector”:‘.dash-spreadsheet-inner-table’,‘rule’:‘text-color: white !important’}
similar to what we do when we want to show the dropdown options in the datatable.
Any help would be appreciated. Thanks!