Placing controls with grid() and pack()
Places a control in a table-like layout at the given row and column. pack() instead stacks controls in order. Never mix grid and pack in one window.
Understanding Placing controls with grid() and pack() in VCE Software Development U3O1
What it does: padx adds horizontal padding (left and right) around the control, while pady adds vertical padding (top and bottom). columnspan=2 makes the control take up two columns, which is useful for headings that sit above two columns of controls. Rows and columns both start at 0, so the first row is row=0 and the second column is column=1. pack() needs no row or column. It simply stacks each control after the previous one. Row and column belong to grid(). Controls on the same row share the same row number but use different column numbers. The correct option name is columnspan. colspan is HTML, not tkinter, and causes an error.
Common mistakes: The grid() call is missing its closing bracket. It should be lb.grid(row=0, column=1) so the label is placed in row 0, column 1. grid() and pack() must not be mixed in one window. The other control uses pack(), so this line should be a.pack().
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 125–141) and word search (Modules 114–141).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
control.grid(row=0, column=1)Fill in the Blanks
Spot the Error
Student with a class code? Join your class →