Adjust spaces between st.image/elements

Dear community,
I am wondering if there is a way to adjust the space (of rows) between images shown by st.image.
I noticed from the html/javascript, mulitple streamlit elements were organized in stVerticalBlock, and there are always stHidden between elements. However, even remove stHidden, does not change the spaces.
Thank you.

A work around would be to insert the image within a column and create buffer columns between the images. That way you can control the space between the images by changing the size of the empty columns.

Hi cualr,
Thank you for the reply.
Currently I am thinking remove all the space between images, which can not be control by the way you suggested.
It would be great if you have any suggestions for the updated question. Thank you.

Try the following code, and make the appropriate change for the “width”.


with col1:
with col2:

Hi curl,
Thank you very much for the solution.
Any ideas to remove space between rows?

Hi @caoyaqiang0410 , check if this thread helps you.