Is it possible to change the background color of a column?


I created 2 columns

col1, col2 = st.columns([6, 2])

I need column 2 to be a certain shade of grey, however Iโ€™m a bit stuck if thatโ€™s realistically possible to do. Any help would be appreciated!

1 Like

You could do a quick CSS injection, or try using a ๐ŸŽจ Styleable Container - streamlit-extras

import streamlit as st

col1, col2 = st.columns([6, 2])

with col1:
    "# Column 1"
    "Text "*100

with col2:
    "# Column 2"
    "Text "*20

            background-color: lightgrey;
    """, unsafe_allow_html=True

Thank you! This worked

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.