Is there any streamlit component that doesn't add divs and div wrapper around the text?

Hi, I need to show some text and variable in the for loop. I would like to add just text to a sentence. But everytime I use any st component (st.write, st.markdown…) it is adding divs and pushing the text into the next row.

Any idea how to fix this? Thanks!

Hi, maybe you can update a variable in the for loop

Something like:

a=st.empty()
for i in range(10):
a.write(str(i))

sebastiandres Hi! Thanks for the response :slight_smile: I tried to do it but it didn’t work.

What I am trying to do is to loop throw the list and assign the answer and to calculate certain score based on the response in the list. So the end result would be: sentence - small circle with tooltip - sentence - small circle with tooltip…and so on. But If I use any of the st components, as you know it creates div containers and dividing the sentences. Maybe it is easier to understand from the screenshot attached. Any idea how to resolve this? :slight_smile:

Ahhha, gotcha.
Then maybe in the loop update a string variable, like all_my_divs where you append the divs with the score, and then later, out of the for-loop, display it?
something in the line of

for item in sentence_similarity:
  score = ...
  ... 
  all_my_divs += """ ... all the html text """
st.markdown(all_my_divs)
1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.