Welcome to Streamlit. Have you tried using pandas styler to change the background color of cell [0,2]? Specifically, you can use set_td_classes as described in Table Visualization — pandas 1.3.3 documentation
Im running one of the demo apps - i cant find the link to it but it is “Gross Agricultural Product ($B)” for China and USA. I try to add some styling to the dataframe but nothing is displayed on the webpage:
import streamlit as st
import pandas as pd
import altair as alt
import time
try:
df = get_UN_data()
countries = st.multiselect(
“Choose countries”, list(df.index), [“China”, “United States of America”]
)
if not countries:
st.error(“Please select at least one country.”)
else:
data = df.loc[countries]
data /= 1000000.0
data = data.sort_index()