from tkinter import * root = Tk( ) b=0 for r in range(6): for c in range(6): b=b+1 Button(root, text=str(b), borderwidth=1 ).grid(row=r,column=c) root.mainloop() This would produce the following result display
Widgets can take up more than a single cell in the grid; to do this, we'll use thecolumnspanandrowspanoptions when gridding the widget. These are analogous to the "colspan" and "rowspan" attributes of HTML tables. Here is an example of creating a user interface with multiple widgets, so...