Want to know how to embed my html code in the streamlit currently facing alignment issue and responsiveness of the webpage with the streamlit


import streamlit as st
from streamlit.components.v1 import html

def main():

  components.html("""
<html>
  <head>
    <title>My App</title>
  </head>
  <body>
  </body>
  </html>""",height=1650, width=900)
                  
    #more functions with streamlit functinality
                  
                  
 
if __name__ == "__main__":
    main()`Preformatted text`

Hi @KaranT

You can use the unsafe_allow_html=True parameter together with st.markdown():

html_code = "<p>Hello world!</p>"
st.markdown(html_code, unsafe_allow_html=True)

Hope this helps!

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