Formatting

HI everyone,

I was wondering how it was possible to add layering/formatting to the app with streamlit. Also if it was possible to do it with a CSS file and if yes, how ?

Thanks a lot,

Anouk

1 Like

Hi @Kalmouk. Great question!

For simple HTML styling like setting text color, please note that you an embed a fair amount of html (including style attribute) into Markdown. To use this, please set unsafe_allow_html=True when using st.markdown().

(Edit: This isn’t working for me. We’re looking into this!)

If you are requesting a more general ability to use CSS styling with Streamlit, please feel free to make a feature request with your requirements so that we can prioritize and design this feature.

Thanks for using Streamlit!

Hi everyone,

I have a similar question about formatting, and I would really appreciate any tips or suggestions! I have table with clickable hyperlinks that I’m currently making using this:

st.write(df.to_html(escape=False), unsafe_allow_html=True)

I need to format this table by adding a background color and centering the header row, dropping vertical divider lines between subsequent rows, and changing the font of the text inside the table. Does anyone know how one can do that, while preserving the clickable hyperlinks inside the table?

Thank you so much for your help!
Marina