Skip to content

Latest commit

 

History

History
32 lines (16 loc) · 1.61 KB

Columns & Tab.md

File metadata and controls

32 lines (16 loc) · 1.61 KB

Here's what each section does:

col1, col2 = st.columns(2)

This line creates two columns within the Streamlit app, dividing the available horizontal space equally between them. It assigns the first column to the variable col1 and the second column to the variable col2.

col1.write('Column 1')` and `col2.write('Column 2')

These lines write text within their respective columns, allowing you to display content specifically within each column.

col1, col2, col3 = st.columns([3,1,1])

This line creates three columns within the Streamlit app, with the first column being three times wider than the other two. It assigns the first column to col1, the second to col2, and the third to col3.

with col1:` and `st.write('This is column 1')

This syntax uses a 'with' statement to specify that the following code block should be executed within col1. In this case, it writes 'This is column 1' within col1.

Tabs Details

tab1, tab2 = st.tabs(["Tab 1", "Tab2"])

This line creates two tabs labeled "Tab 1" and "Tab 2" within the Streamlit app. It assigns the first tab to the variable tab1 and the second tab to the variable tab2.

tab1.write("this is tab 1")` and `tab2.write("this is tab 2")

These lines write text within their respective tabs, allowing you to display content specifically within each tab.

`with tab1:` and `st.radio('Select one:', [1, 2])

This syntax uses a 'with' statement to specify that the following code block should be executed within tab1. In this case, it displays a radio button widget labeled "Select one:" with options 1 and 2 within tab1.