import tkinter as tk from tkhtmlview import HTMLScrolledText root = tk.Tk() root.geometry("780x640") html_label = HTMLScrolledText( root, html="""

Hello World

Smaller

Little Smaller

Little Little Smaller

Little Little Little Smaller
Little Little Little Little Smaller
This is a Bold text
This is an Important text
This is a Italic text
This is a Emphasized text
This is a Strong Emphasized text .

Paragraph

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut quam sapien. Maecenas porta tempus mauris sed ullamcorper. Nulla facilisi. Nulla facilisi. Mauris tristique ipsum et efficitur lobortis. Sed pharetra ipsum non lacinia dignissim. Ut condimentum vulputate sem eget scelerisque. Curabitur ornare augue enim, sed volutpat enim finibus id.

Table

T Header 1 T Header 2 ABC 123 DEF 456

Preformatted text: spaces and newlines preserved

Tags      Attributes          Notes
a         style, href         -
img       src, width, height  experimental
ol        style, type         -
ul        style               bullet glyphs only
div       style               -
      

Code: spaces and newlines ignored

Tags Attributes Notes
a style, href - img src, width, height experimental ol style, type - ul style bullet glyphs only div style -

Inline code blocks displayed without newlines

""", ) html_label.pack(fill="both", expand=True) html_label.fit_height() root.mainloop()