I'm trying to use ttk.Treeview() for sortable tables. It would be helpful if I could show grid lines. I tried to use Style() for this but found nothing. Does anyone have an idea how to do that?
from Tkinter import *
import ttk
header = ['col1', 'col2']
data = [('a', '4') ,('b', '1') ,('c', '2') ,('d', '3') ,('e', '5')]
root = Tk()
f1 = ttk.Frame(root)
f1.pack()
t1 = ttk.Treeview(f1, columns=header, show="headings")
t1.pack()
for col in header:
t1.heading(col, text=col.title())
for item in data:
t1.insert('', 'end', values=item, tags=('items',))
root.mainloop()