Horizontal checkbox

I try to apply the solution of horizontal radio buttons to checkbox. But it fails. I use the browser inspect tool and find out that checkbox elements are not wrapped as a stable group so I cannot directly modify the style elements. Any solution? Thank you in advance.

Since checkboxes are independent elements, you can use columns to create a row:

checks = st.columns(4)
with checks[0]:
    st.checkbox('0')
with checks[1]:
    st.checkbox('1')
with checks[2]:
    st.checkbox('2')
with checks[3]:
    st.checkbox('3')
1 Like