How to remove spacing between the button

Hi there, I am new to Streamlit and designing an app. I have added two columns to add buttons vertically but unable to remove the spacing between the button. Please tell me how can I remove the spacing between the buttons? Here is the code snippet:

with embedding:
st.subheader(‘Embedding Method’)
#Using columns function to make two columns
col1,col2 = st.columns(2)
col1.button(‘BERT’)
col2.button(‘Google News’)

1 Like

Hi @Abdul, and welcome to the Streamlit community! :raised_hands:

You can remove spaces by opting for brackets in st.columns, e.g.:

st.subheader("Embedding Method")
# Using columns function to make two columns
col1, col2, col3 = st.columns([1, 1, 5])
col1.button("BERT")
col2.button("Google News")

will output:

image

I hope that helps!

Best,
Charly

Thanks for your help @Charly_Wargnier . Is there any way I can add multiple buttons in one column? Because this space is still too much. I just want them side by side with almost no spacing.

Sorted. Thanks for your help.

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