HI @hamedk and welcome to the Dash community
One way to do this is to use a variable to update the background color for the cells.
Here is an example:
import dash
import dash_table
import pandas as pd
data = dict([("a", [4, 2, 1]), ("b", [6, 3, 0])])
df = pd.DataFrame(data)
bg_color = "white"
if df.iloc[2]["a"] == 1:
bg_color = "green"
app = dash.Dash(__name__)
app.layout = dash_table.DataTable(
data=df.to_dict("records"),
columns=[{"name": i, "id": i} for i in df.columns],
style_data_conditional=[
{
"if": {"row_index": 0, "column_id": "a"},
"backgroundColor": bg_color,
},
],
)
if __name__ == "__main__":
app.run_server(debug=True)