Insert containers laid out as side-by-side columns.
Function signature

st.columns(spec: Union[int, Sequence[Union[int, float]]])


spec (int or list of numbers)

If an int
Specifies the number of columns to insert, and all columns have equal width.
If a list of numbers

Creates a column for each number, and each column's width is proportional to the number provided. Numbers can be ints or floats, but they must be positive.

For example, st.columns([3, 1, 2]) creates 3 columns where the first column is 3 times the width of the second, and the last column is 2 times that width.

Was this page helpful?


Still have questions?

Our forums are full of helpful information and Streamlit experts.