Change width of selectbox

I want to change the width of some specific selectbox in the page. Any solution from the community appreciated.

Hi, you can do the following:

  1. Create a set of columns (using st.columns) for that row where your selectbox currently lies. Refer Streamlit docs. The column specs will be list of numbers and not a single integer. That way you can decide on the number of columns on that row and their relative width to each other.
  2. Place your selectbox in one of those columns (depending on how you want to horizontally position it) on that row.
  3. The width of the selectbox with now be restricted to the column width (in which it is placed).

Cheers

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