when using wide layout , my app is left aligned than i expect
st.set_page_config(page_title=“Test”,layout=‘wide’)
is there a way to achieve padding throught the app ? for example i want to achive col1 , which is empty ,throught out the page .
if i use layout=‘centered’ , col5 and col6 are squished , the UI experience isnt good . for the data in it , wide layout works better .
1 Like
hey @dataexplorer,
If I understand the question I have a solution for you. To get col1 to be empty, you need to create a buffer
column that you initiate every time you make columns, that is the same size each time. Checkout this code snippet I made for you:
import streamlit as st
import pandas as pd
import numpy as np
st.set_page_config(page_title="My App",layout='wide')
#the buffer = col1 in your diagram and we never put anything in it
buffer, col2, col3, col4 = st.beta_columns([1,2,2,1])
with col2:
st.write("This is in column 2")
with col3:
st.write("And column 3")
with col4:
st.write("This column is half the size of 2 and 3")
column_names = ['a','b','c','d','e','f','g']
pandas_data = pd.DataFrame(np.random.randn(50,7), columns=column_names)
# this creates the 2nd row of columns,
# we still need to add the buffer in as the first one
buffer, col5, col6 = st.beta_columns([1,3,3])
with col5:
st.dataframe(pandas_data)
with col6:
st.table(pandas_data.iloc[0:10])
this outputs:
Happy Streamlit-ing!
Marisa
4 Likes
It is what i am looking for .Thank you @Marisa_Smith .
1 Like
Hi All,
Is it possible to have a layout similar to the attached picture?
Thank you