import streamlit as st st.title('Unit 5. Layouts & Containers') st.caption('참조사이트: https://docs.streamlit.io/library/api-reference/layout') # sidebar- with 사용하기 📧 📱 📞 with st.sidebar: st.header('1. Sidebar') add_selectbox = st.sidebar.selectbox('어떻게 연락드릴까요?', ('Email', 'Mobile', 'Ofice Phone') ) if add_selectbox == 'Email': st.sidebar.title('📧') elif add_selectbox == 'Mobile': st.sidebar.title('📱') elif add_selectbox == 'Ofice Phone': st.sidebar.title('📞') # columns Cat = 'https://images.pexels.com/photos/2071873/pexels-photo-2071873.jpeg?auto=compress&cs=tinysrgb' Dog = 'https://images.pexels.com/photos/3361739/pexels-photo-3361739.jpeg?auto=compress&cs=tinysrgb' Owl = 'https://images.pexels.com/photos/3737300/pexels-photo-3737300.jpeg?auto=compress&cs=tinysrgb' st.header('2. Columns') col1, col2, col3 = st.columns(3) with col1: st.text('Cat') st.image(Cat) with col2: st.text('Dog') st.image(Dog) with col3: st.text('Owl') st.image(Owl) # # tabs - width=200 st.header('3. Tabs') tab1, tab2, tab3 = st.tabs(['Cat', 'Dog', 'Owl']) with tab1: st.text('Cat') st.image(Cat, caption='This is a cat', width=300) with tab2: st.text('Dog') st.image(Dog, caption='This is a dog', width=300) with tab3: st.text('Owl') st.image(Owl, caption='This is an owl', width=300)