Move object to right

I assume this is not that difficult, however I have not been able to find the answer anywhere! I am currently writing a header followed by a metric:

st.header('Test')
st.metric('Some Measure, st.session_state.measure)

I’d prefer to put the metric on the same height as the header, but on the far right.
Does anyone know how I can accomplish this?
Thank you in advance.

Hi @Placido_Pellegriti

You can use columns to add structured layouts to the app, something like the following:

col1, col2, col3 = st.columns((1,5,1))

with col1:
   st.header('Test')
with col3:
   st.metric('Some Measure, st.session_state.measure)

Hope this helps!

1 Like

This is exactly what I was looking for! Thank you a lot.

1 Like

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