Treeview widget hiển thị dữ liệu phân cấp/bảng. Cấu hình vị trí text trong cột bằng property anchor.
Để căn phải (right align): anchor=E (East).
Ví dụ
from tkinter import *
from tkinter import ttk
win = Tk()
win.geometry("700x350")
style = ttk.Style()
style.theme_use('clam')
tree = ttk.Treeview(win, column=("c1", "c2"), show='headings', height=8)
tree.column("# 1", anchor=E, stretch=NO, width=100)
tree.heading("# 1", text="Index")
tree.column("# 2", anchor=E, stretch=NO)
tree.heading("# 2", text="Programming Language")
# Insert data
for i, (idx, lang) in enumerate([(1,'C++'),(2,'Java'),(3,'Python'),(4,'Golang'),(5,'JavaScript'),(6,'C#'),(7,'Rust'),(8,'SQL')], 1):
tree.insert('', 'end', text=str(i), values=(idx, lang))
tree.pack()
win.mainloop()
Kết quả
Treeview 2 cột Index và Programming Language, text cả 2 cột căn phải (anchor=E).

Anchor options: W (trái), CENTER (giữa), E (phải). stretch=NO cố định width.