How to get a more compact grid


Here is a screen capture from a streamlit test.
It creates a grid of text_input widgets (I will also need some selectbox):


Would there be an easy way to get a more compact layout ?
The space between the rows is much too large.
The padding of the text_input widgets is much also too large.



Code used to generate this example:

cols = st.beta_columns([2]*12)

for name,c in zip(['name','type','Q','Qv','q1','qv1','q2','qv2','dfQ','dfq'], cols[1:-1]):
    with c:
        st.markdown(f"__{name}__") = [st.text_input(label='',key=f'{name}{i}',value=f'{name}{i}') for i in range(5)]

You can take insparation from the various css hacks that have been discussed here on the community pages and place the code in a st.markdown object.

If you want a table that you can modify, take a look at the excellent AgGrid component

Thanks Maarten !

Could you point me to some of these hacks?
Or is there somewhere a general explanation about how to use css hacks with streamlit ?

Regarding AgGrid, I could not find a way to insert a selectbox widget in a cell.
Learning the javascript api and how to bridge it, would consume much more thant the time I have available.
I post a question about how to insert a selectbox in AgGrid, if possible.