Afficher texte en gras dans HTMLLabel
Bonjour,
Certaines mise en forme (et notamment en gras) ne fonctionnent pas dans un widget HTMLLabel.
Voici un exemple :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
from tkinter import *
from tkhtmlview import HTMLLabel
root=Tk()
root.geometry('1200x1150')
widgetHTML=HTMLLabel(root,html="""
<head>
</head>
<body>
<p style=font-weight: 700>Mettre en gras --> KO</p>
<p style=font-weight: bold>Mettre en gras --> KO</p>
<p style=font-style: italic>Mettre en italique --> KO</p>
<p style=background-color:green;font-size:18px>surligner --> OK</p>
<p style=font-size:8px;color:#FF0000>taille et couleur de police --> OK</p>
</body>
""")
widgetHTML.pack()
root.mainloop() |
Quelqu'un pourrait-il tester ce code? :fleur: