Show HTML in a tab

Hi all,

I am trying to display an html file in a tab but it is not showing the contents. The html display fine when using components though, so this must be related to tabs?

Code:

for i, tab in enumerate(tabs):
_tab_name = tab_list[i]

response = s3_client.get_object(Bucket=bucket_name, Key=key)
html_content = response['Body'].read().decode('utf-8')

tab.html(html_content)

Python: 3.11
Streamlit: 1.38.0

Your code works for me after defining the undefined names.

For me it just displays white / blank space…

The problem doesn’t seem to be in the code that you posted here but in something else that you didn’t show us. Maybe the value of html_content.

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