# Chai Taste Poll- steamlit

Now this section we discuss about layout and other things img and handling

### layout

when you need divided page into the 2 section then we use st.cols

```python
cols1,cols2 = st.columns(2)
```

this code divided page into 2 section

```python

cols1,cols2 = st.columns(2)

with cols1:
    st.header("Masala Chai")
    st.image("https://images.pexels.com/photos/230489/pexels-photo-230489.jpeg",width=200)
    vote1=st.button("Vote Masala Chai")
with cols2:
    st.header("Adhark Chai")
    st.image("https://images.pexels.com/photos/905485/pexels-photo-905485.jpeg",width=200)
    vote2=st.button("Vote Adarak Chai")

if vote1 :
    st.success("Thanks for voting Masala chai")
elif vote2 :
    st.success("Thanks for voting Adhark chai")
```

### In the above code, the first section is `col1` and the second is `col2`.

Below `col1`, we also define a header — this is valid, meaning the page header is different from the headers inside `col1`, `col2`, and the main page.

`st.image` – This is used to display an image in our application.

### sidebar

when we need use sidebar it’s simple

```python

name=st.sidebar.text_input("Enter your name")
tea = st.sidebar.selectbox("choose your tea",["Masala","kesar","Adarak"])
```

### Expander

This beautiful expander gives us an easy-to-use interface with a smooth, attractive animation.

```python
with st.expander("Show Chai Making instructions"):
    st.write("""
    1. Boil water with tea leaves
    2. Add Milk and Spices
    3. server hot
""")
```

### markdown

When using Markdown, check the syntax below:

```python
st.markdown('### Welcome to chai App')

st.markdown('> Blockquote')
```

### Preview

img

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1755096822857/ebae34e1-4a68-4f92-acc6-4b1b7a0a685c.png align="center")

### video

%[https://youtu.be/usZL_DFAogI] 

## Source code

github: [https://github.com/mr-AnandShinde-358/chai-streamlit](https://github.com/mr-AnandShinde-358/chai-streamlit)

### Reference:

### Chai aur code - Youtube channel : [https://www.youtube.com/@chaiaurcode](https://www.youtube.com/@chaiaurcode)

### streamlit doc - [https://docs.streamlit.io](https://docs.streamlit.io/)/
