Example : Streamlit Python codes to create different types of Text Boxes.
import streamlit as st
col1, col2, col3 = st.columns([1, 1, 1]) # Middle column is 2 times wider
with col2:
slno = st.text_input("Slno1") # This input box will be narrower
col1, col2, col3 = st.columns([1, 2, 1]) # Middle column is 2 times wider
with col2:
slno = st.text_input("Slno2") # This input box will be narrower
col1, col2, col3 = st.columns([1, 3, 1]) # Middle column is 2 times wider
with col2:
slno = st.text_input("Slno3") # This input box will be narrower
col1, col2, col3 = st.columns([1, 4, 1]) # Middle column is 2 times wider
with col2:
slno = st.text_input("Slno4") # This input box will be narrower
Example : Streamlit Python codes to create different types of Column Text Boxes.
import streamlit as st
# Create two columns
col1, col2 = st.columns(2)
# Place input boxes inside each column
with col1:
input1 = st.text_input("First Name")
with col2:
input2 = st.text_input("Last Name")
st.write("---------------------------------")
col1, col2 = st.columns([1, 3]) # First column is smaller
with col1:
input1 = st.text_input("Code")
with col2:
input2 = st.date_input("DOB")
st.write("---------------------------------")
# Create three columns
col1, col2, col3 = st.columns([1, 2, 2]) # Adjust widths as needed
# First column with two input boxes
with col1:
input1 = st.text_input("First Input (Col 1)")
input2 = st.date_input("Second Input (Col 1)")
# Empty second column (for spacing or other elements)
with col2:
st.write("") # Placeholder, can be removed
# Third column with two input boxes
with col3:
input3 = st.date_input("First Input (Col 3)")
input4 = st.text_input("Second Input (Col 3)")
st.write("---------------------------------")
# Create three columns
col1, col2, col3 = st.columns([1, 2, 2]) # Adjust widths as needed
# First column with two input boxes
with col1:
input1 = st.text_input("Slno")
# Empty second column (for spacing or other elements)
with col2:
st.write("") # Placeholder, can be removed
# Third column with two input boxes
with col3:
input4 = st.date_input("DOB1")
with col1:
input14 = st.date_input("Age")
input6 = st.text_input("Name")
0 Comments