Simple 2d table : Layout « Tkinker « Python Tutorial






Simple 2d table
from Tkinter import *
     
for i in range(5):
    for j in range(4):
        l = Label(text='%d.%d' % (i, j), relief=RIDGE)
        l.grid(row=i, column=j, sticky=NSEW)
     
mainloop()








18.18.Layout
18.18.1.Pack to TOP and RIGHTPack to TOP and RIGHT
18.18.2.Grid layoutGrid layout
18.18.3.Pack leftPack left
18.18.4.Pack layout manager demonstration.Pack layout manager demonstration.
18.18.5.Grid layout manager demonstration.Grid layout manager demonstration.
18.18.6.Demonstrates text and entry widgets, and the grid layout managerDemonstrates text and entry widgets, and the grid layout manager
18.18.7.Simple 2d tableSimple 2d table
18.18.8.2d table of input fields2d table of input fields