Tkinter Grid layout management by row & columns & aligning in both horizontal & vertical directions

preview_player
Показать описание
Grid layout
Grid layout system depends on rows and columns, we can give numbers to rows and columns and place the widget on the window using that.

Relative numbering of rows and columns
All layout numbers are relative to each other so we can start with any number for the first component at top left corner and then increase it. Rows increases in vertical direction and columns increases in horizontal direction.
Alignment in horizontal direction
We can use sticky option of grid to align the widget in both horizontal and vertical direction.
By using sticky option to East (E) or West ( W ) we can align in Horizontal direction. Similarly for vertical alignment we can use sticky as North ( N ) and South(S) .
We can manage both horizontal and vertical alignment by using NE or NW or SE or SW values.
Рекомендации по теме