row col row col row col row col row col using the grid layout managerwhat happens is that the width of any given column is determined by the longest name or widget in that column this affects all the rows by adding our labelframe widget and giving it title that is longer than some hardcoded size widgetsuch as the top-left label and the text entry below itwe dynamically move those widgets to the center of column adding space on the leftand right-hand side of those widgets the following code can be added to label frame code shown above and then placed labels in to his frame aligning the gui widgets by embedding frames within frames the dynamic behavior of python and its gui modules can create little bit of challenge to really get our gui looking the way we want herewe will embed frames within frames to get more control of our layout this will establish stronger hierarchy among the different ui elementsmaking the visual appearance easier to achieve herewe will create top-level frame that will contain other frames and widgets this will help us get our gui layout just the way we want in order to do sowe will have to embed our current controls within central frame called ttk labelframe this frame ttk labelframe is the child of the main parent window and all controls will be the children of this ttk labelframe we will only assign labelframe to our main window and after thatwe will make this labelframe the parent container for all the widgets fig hierarchy layout in gui