How do I center a button with Streamlit so that the button is still clickable? Here is a small example for a button that returns random numbers:
import streamlit as st
import numpy as np
if st.button('Click'):
rand = np.random.standard_normal()
st.write(str(rand))
I've seen solutions with markdown for a title, but not for an interactive element like a button.
col1, col2, col3 = st.beta_columns(3)
if col2.button('Click'):
st.write('hello')
Right now that’s not supported in Streamlit, but we are working on it (see our Roadmap for more info). Feel free to add your ideas to Customizable Layout for Streamlit discussion.
And thanks for using Streamlit!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With