How can i aplly the conditial formatting to all the DataTables ?
from dash import Dash, dash_table
import pandas as pd
from collections import OrderedDict
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash import html
app = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
data = OrderedDict(
[
("Title", ["one", "two", "treem"]),
("COL1", [50, 20, 80]),
("COL2", [10, 40, 90])
]
)
df = pd.DataFrame(data)
########♦
style_cell_conditional = [ {'if': {'column_id': 'Title'},'backgroundColor': 'gray'}]
#########
app.layout = dbc.Container([
#rij1
dbc.Row([
dbc.Col([dash_table.DataTable(data=df.to_dict('records'))],width=3),
dbc.Col([dash_table.DataTable(data=df.to_dict('records'))],width=3),
dbc.Col([dash_table.DataTable(data=df.to_dict('records'))],width=3),
dbc.Col([dash_table.DataTable(data=df.to_dict('records'))],width=3)
]),
#rij2
dbc.Row([
dbc.Col([dash_table.DataTable(data=df.to_dict('records'))],width=3),
dbc.Col([dash_table.DataTable(data=df.to_dict('records'))],width=3),
dbc.Col([dash_table.DataTable(data=df.to_dict('records'))],width=3),
dbc.Col([dash_table.DataTable(data=df.to_dict('records'))],width=3)
]),
])
if __name__ == '__main__':
app.run_server(debug=True)