How to set the height of a column in Tableview? #346
Unanswered
zhenzi0322
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
Changing the height of a single row is not possible, but you can create a custom style to change the height of all rows import ttkbootstrap as ttk
from ttkbootstrap.tableview import Tableview
from ttkbootstrap.constants import *
app = ttk.Window()
colors = app.style.colors
style = ttk.Style()
style.configure('custom.primary.Treeview', rowheight=100, font=('', 12))
style.configure('custom.primary.Treeview.Heading', font=('', 10, 'bold'))
coldata = [
{"text": "LicenseNumber", "stretch": False},
"CompanyName",
{"text": "UserCount", "stretch": False},
]
rowdata = [
('A123', 'IzzyCo', 12),
('A136', 'Kimdee Inc.', 45),
('A158', 'Farmadding Co.', 36)
]
dt = Tableview(
master=app,
coldata=coldata,
rowdata=rowdata,
paginated=True,
searchable=True,
height=20, # Tableview height
bootstyle=PRIMARY,
stripecolor=(colors.light, None),
)
dt.pack(fill=BOTH, expand=YES, padx=10, pady=10)
dt.configure(style='custom.primary.Treeview')
app.mainloop()see too: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions