Hello everyone. In app I am developing, I am using css styling to format the color, font, font size etc of some of my subheaders that have been created using st. markdown. So as an example, one of the subheaders is created in this way:
Subheader_Volumes = '<p style="font-family: Arial; color: White; font-size: 25px">Volumes (in 000)</p>'
st.markdown(Subheader_Volumes, unsafe_allow_html=True)
I also have subheaders that contain a metric/KPI/ BAN. One such example is a KPI called volumes, the code for this currently used is this:
st.subheader(f"{Volumes:,}")
Volumes is actually a filtered dataset that gets pulled into the subheader.
I would like this subheader to also have an Arial font and with white color. However, when I try using the st.markdown option to do so, I get an error because I donât know how to do it correctly. It doesnât display the number, instead it just displays the text if I use this code:
Subheader_VolumesKPI = '<p style="font-family: Arial; color: White; font-size: 25px">f"{Volumes:,}"</p>'
st.markdown(Subheade_VolumesKPI, unsafe_allow_html=True)
How would I have to change the code so the markdown takes the number that is being calculated by the filtered dataframe so that the number becomes White, Arial etc.
Any help is much appreciated.
KR
Christoffer