Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Conditional formatting of an html element

$
0
0

Hello dear Dash wizards,

I know there is a conditional formatting property for dash data table but is there a way to change the text color and background color of a html.P or html.H4 element based on a condition in a callback function with Dash?

For example, it could be something like this (very schematically):
def function():
if temperature > 25:
background text color for temperature = green
else:
background text color for temperature = red

Thanks for your help!
David

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles