I am exploring using the st.dataframe component, and color the row if the ‘If Input Change’ column = ‘Change’. The table has all blacks in all rows except the 1st row.
streamlit version = 1.29.0
return (
["background-color:antiquewhite"] * len(row)
if row["If Input Change"]
in ["Change"]
else ["background-color:white"] * len(row)
)
st.dataframe(
input_change_ptp.head().style.apply(
color_coding_change_flag, axis=1
),
height=1600,
# hide_index=True
)
The similar code works on a different table but didn’t work on this one.