Add vertical or horizontal space.
This command adds space in the direction of its parent container. In a vertical layout, it adds vertical space. In a horizontal layout, it adds horizontal space.
| Function signature[source] | |
|---|---|
st.space(size="small") | |
| Parameters | |
size ("small", "medium", "large", "stretch", or int) | The size of the space. This can be one of the following values:
|
Examples
Example 1: Use vertical space to align elements
Use small spaces to replace label heights. Use medium spaces to replace two label heights or a button.
Example 2: Add horizontal space in a container
Use stretch space to float elements left and right.
Still have questions?
Our forums are full of helpful information and Streamlit experts.
