【发布时间】:2021-01-02 09:59:56
【问题描述】:
我想做三行的树形视图,表格的大小应该是三行 我尝试了以下代码
tv1 = ttk.Treeview(self)
tv1['columns'] = ('Expiry','Name')
tv1.heading("#0", text='Symbol', anchor='center')
tv1.column("#0", anchor="center")
tv1.heading('Expiry', text='Expiry')
tv1.column('Expiry', anchor='center', width=100)
tv1.heading('Name', text='Full Name')
tv1.column('Name', anchor='center', width=100)
tv1.grid(row=0,column=12,sticky='n')
init.treeview1 = tv1
self.grid_rowconfigure(0, weight = 1)
self.grid_columnconfigure(0, weight = 1)
【问题讨论】:
-
树视图有一个记录在案的
height属性。你试过用吗? -
不,谢谢你的建议,我会试试的。