How do I left-justify the information in the labels?

Peter Otten __peter__ at web.de
Sun Aug 30 10:32:10 EDT 2020


Steve wrote:

> How do I left-justify the information in the labels?

>          SVRlabel = ttk.Label(window, text = SpecLine + "  "*5)
>          SVRlabel.grid(column = 1, row = x)

The text in the labels already is left-justified -- but the labels 
themselves are centered inside the grid cells.

You can change that with

label = ttk.Label(window, text=SpecLine)
label.grid(column=1, row=x, sticky=tkinter.W)  # W for "west"

See https://tkdocs.com/shipman/grid.html.



More information about the Python-list mailing list