Can we control row in streamlit write

here is the API reference

st.title("Let's create a table!")
for i in range(1, 10):
    cols = st.beta_columns(4)
    cols[0].write(f'{i}')
    cols[1].write(f'{i * i}')
    cols[2].write(f'{i * i * i}')
    cols[3].write('x' * i)

AND now
i want to result like
A B β€œblank here”
1 2 3
c1,c2,c3 = st.beta_columns(3)
c1.write(β€˜A’)
c2.write(β€˜B’)
c3.write(’ ')<----
c1.write(β€˜1’)
c2.write(β€˜2’)
c3.write(β€˜3’)

and then β€˜3’ become not in align with β€œrow”

You left out creating another row of colums. If you do this, you should get what you want:

import streamlit as st

st.title("Let's create a table!")
c1, c2, c3 = st.beta_columns(3)
c1.write("A")
c2.write("B")
c3.write(" ")
c1, c2, c3 = st.beta_columns(3) <--- You need to add this
c1.write("1")
c2.write("2")
c3.write("3")

Dinesh

1 Like

thanks you and merry Xmas