The padding options padx and pady of the grid and pack methods can take a 2-tuple that represent the left/right and top/bottom padding.

Here's an example:

import tkinter as tk

class MyApp():
    def __init__(self):
        self.root = tk.Tk()
        l1 = tk.Label(self.root, text="Hello")
        l2 = tk.Label(self.root, text="World")
        l1.grid(row=0, column=0, padx=(100, 10))
        l2.grid(row=1, column=0, padx=(10, 100)) 

app = MyApp()
app.root.mainloop()
Answer from Bryan Oakley on Stack Overflow
🌐
TkDocs
tkdocs.com › tutorial › grid.html
TkDocs Tutorial - The Grid Geometry Manager
The columnconfigure and rowconfigure methods accept a pad option. This increases the requested size for each widget to account for padding, but does not put extra padding around the widget, which must still be done via padx and/or pady. Let's add the extra sticky, resizing, and padding behavior ...
Discussions

ipadx/ipady Only Pad right/bottom on tkinter Frame with Grid Layout Manager
Bug report Using the Grid layout manager to place a Frame, the ipadx and ipady options only produce padding on the bottom and right sides. As you can see in the following code, I'm not adding p... More on github.com
🌐 github.com
6
April 25, 2023
TKinter / make some space between elements?
Both the pack and grid methods also support padx/pady key-word arguments, which introduces space between elements. More on reddit.com
🌐 r/learnpython
6
3
September 24, 2021
🌐
Python Tutorial
pythontutorial.net › home › tkinter tutorial › tkinter grid
Tkinter Grid Geometry Manager - Python Tutorial
April 4, 2025 - Use sticky option to align the position of the widget on a cell and define how the widget will be stretched. Use ipadx, ipady and padx, pady to add internal and external paddings. ... Tkinter Hello, World!
🌐
Tutorialspoint
tutorialspoint.com › python › tk_grid.htm
Tkinter grid() Method
padx, pady − How many pixels to pad widget, horizontally and vertically, outside v's borders.
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-add-padding-to-a-tkinter-widget-only-on-one-side
How to Add padding to a tkinter widget only on one side ? - GeeksforGeeks
March 15, 2021 - Moreover, give the padding where we want to give it. l1.grid(padx=(padding from left side, padding from right side), pady=(padding from top, padding from bottom))
🌐
Narkive
comp.lang.python.narkive.com › LdMp1L6u › default-padding-for-tkinter-grid
Default padding for Tkinter grid
You have to call grid() once on every widget, so adding **padding at the end doesn't appear too bad to me: label = Label(master, text="Hello world!") widget.grid(row=3, col=1, **padding) What about a function: def grid_with_padding(widget, padx='1m', pady='1m', **kw): widget.grid(padx=padx, pady=pady, **kw) If you want an uniform padding: def add_padding(container, padx='1m', pady='1m'): nc, nr = container.grid_size() for i in range(nc): container.grid_columnconfigure(i, pad=padx) for i in range(nr): container.grid_rowconfigure(i, pad=pady) ... Post by Amr I've been spending the last few days experimenting with Tkinter.
🌐
Medium
medium.com › @fulton_shaun › tkinter-ui-layout-with-grid-and-place-b4bef98c0ad4
Tkinter: UI Layout with grid() and place() | by Shaun Fulton | Medium
May 25, 2025 - username_label.grid(row=0, column=0, sticky="e", padx=10, pady=5) username_entry.grid(row=0, column=1, padx=10, pady=5) This adds 10px space left/right and 5px top/bottom between widgets.
Find elsewhere
🌐
Python GUIs
pythonguis.com › tutorials › getting started with tkinter › using the grid geometry manager in tkinter
Using the Grid Geometry Manager in Tkinter
October 9, 2022 - ipadx, ipady: specify how many pixels to use for internal padding · sticky: specifies which side of the cell the widget will stick to. The sticky argument can take the values S, N, E, or W for south, north, east, and west. It can also be a combination of them NW, NE, SW, or SE. If you use W+E+N+S, then the widget will fill the cell. The default behavior is to center the widget within the cell. The following is just a quick example of how to lay out a window using the grid geometry manager in Tkinter...
🌐
AskPython
askpython.com › home › tkinter tutorial – add padding to your windows
Tkinter Tutorial - Add Padding to Your Windows - AskPython
March 28, 2022 - Now we can see that when we set padx = (100, 0) it gets somewhat aside from the center. This option will place or move our label somewhat far from the top margin of the window. We will just change the parameter and the rest of the code remains the same. ... from tkinter import * window = Tk() window.title("Padding in Tkinter") window.geometry("400x400") window.config(background = "Light Blue") label_1 = Label(window, text = "Label_1", bg = "white", fg = "black", font = ("Arial", 30)) label_1.pack(pady = 100) window.mainloop()
🌐
Python Guides
pythonguides.com › python-tkinter-grid
How To Create Responsive Layouts With Python Tkinter's Grid Geometry Manager?
March 19, 2025 - Be consistent with padding: Use the padx and pady parameters consistently to create a visually balanced layout with appropriate spacing between widgets. Test responsiveness: Resize your application window to ensure that the layout remains functional and visually appealing at different sizes.
🌐
GitHub
github.com › python › cpython › issues › 103862
ipadx/ipady Only Pad right/bottom on tkinter Frame with Grid Layout Manager · Issue #103862 · python/cpython
April 25, 2023 - import tkinter as tk window = tk.Tk() frame = tk.Frame(master=window, relief=tk.GROOVE, borderwidth=3) label = tk.Label(text="Text should go in here:", master=frame) entry = tk.Entry(width=20, master=frame) button = tk.Button(text="This button", background="#000000", foreground="#FFFFFF", height=0, width=0, master=frame) label.grid(row=0, column=0, sticky="w") entry.grid(row=1, column=0, sticky="w") button.grid(row=2, column=0, sticky="se") frame.grid(row=0, column=0, ipadx=5, ipady=5) # !!!
Author   Rybec
🌐
Universidad de Granada
ccia.ugr.es › mgsilvente › tkinterbook › grid.htm
The tkinter Grid Geometry Manager
Optional vertical padding to place around the widget in a cell. Default is 0. ... Insert the widget at this row. Row numbers start with 0. If omitted, defaults to the first empty row in the grid.
🌐
Python GUIs
pythonguis.com › faq › when to use pack, place or grid in tkinter
Tkinter Pack vs Grid vs Place — Which Layout Manager Should You Use?
September 18, 2019 - ipadx, ipady -- how many pixels to use for padding inside the widget, also for horizontal or vertical padding. sticky -- specify a value of 's', 'n', 'e', 'w', or a combination of them, e.g. 'nw', 'ne', 'sw', or 'se'. The parameter tells which side of the 'cell' the widget will 'stick' to . If you use 'w'+'e'+'n'+'s', then the widget will fill up the 'cell'. Default is to center the widget within the 'cell'. Below is the code for the photo editor using Tkinter and the grid layout manager.
🌐
Rip Tutorial
riptutorial.com › grid()
tkinter Tutorial => grid()
from tkinter import * root = Tk() btn_column = Button(root, text="I'm in column 3") btn_column.grid(column=3) btn_columnspan = Button(root, text="I have a columnspan of 3") btn_columnspan.grid(columnspan=3) btn_ipadx = Button(root, text="ipadx of 4") btn_ipadx.grid(ipadx=4) btn_ipady = Button(root, text="ipady of 4") btn_ipady.grid(ipady=4) btn_padx = Button(root, text="padx of 4") btn_padx.grid(padx=4) btn_pady = Button(root, text="pady of 4") btn_pady.grid(pady=4) btn_row = Button(root, text="I'm in row 2") btn_row.grid(row=2) btn_rowspan = Button(root, text="Rowspan of 2") btn_rowspan.grid(rowspan=2) btn_sticky = Button(root, text="I'm stuck to north-east") btn_sticky.grid(sticky=NE) root.mainloop() Result ·
🌐
TutorialsPoint
tutorialspoint.com › how-to-add-space-between-two-widgets-placed-in-a-grid-in-tkinter
How to add space between two widgets placed in a grid in tkinter?
In order to add padding, assign the values to padx and pady. #Import the required library from tkinter import * #create an instance of tkinter frame win= Tk() win.geometry("750x250") #Create some Button widgets Label(win, text= "New Line Text", font= ('Helvetica 20 bold')).grid(row=0, column=5, ...
🌐
EDUCBA
educba.com › home › software development › software development tutorials › tkinter tutorial › tkinter grid
Tkinter Grid | Lists of Options in Tkinter Grid with Various Examples
March 27, 2023 - Tkinter grid provides some manager classes to manage widgets such as pack(), grid() and place(). As Tkinter is a Python module for GUI, it has a grid method that needs to be imported from Tkinter. ... Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more. ... column: This option is used to put the widget in a column that is leftmost column. The default column is 0. columnspan: This option keeps track of how many columns it will take to occupy widgets, and by default, this is 1. ipadx and ipady: These two options are used for how many pixels on the interface to pad the widgets in horizontal and vertical, respectively, but it will be used in padding inside the widgets border.
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
Reddit
reddit.com › r/learnpython › tkinter / make some space between elements?
r/learnpython on Reddit: TKinter / make some space between elements?
September 24, 2021 -

Hello - i have created the following application - but i would like to make more space between the elements -(i tried it with padx and pady - but with this commands i only get the elements "bigger" but not more space BETWEEN the elements)

https://ibb.co/94sMgmv

eg. for the Buttons(only spacing with this inside the button - but not around them)

myB = Button(root,text="Generate",command=show,padx=10,pady=10)
myB2 = Button(root,text="Reset",command=reset,padx=10,pady=10)

I would need something like "margin" in css for tkinter?Is there anything similar?

🌐
15. The Menu widget
anzeljg.github.io › rin2 › book2 › 2405 › docs › tkinter › grid.html
4.1. The .grid() method
To display a widget w on your application screen: · This method registers a widget w with the grid geometry manager—if you don't do this, the widget will exist internally, but it will not be visible on the screen. For the options, see Table 1, “Arguments of the .grid() geometry manager”
🌐
CodeSpeedy
codespeedy.com › home › add padding to a tkinter widget only on one side in python
Add padding to a Tkinter widget only on one side in Python - CodeSpeedy
January 22, 2022 - #import the required librearies like tkinter from tkinter import * #Now create a object of tkinter tkobj = Tk() tkobj.title("Codespeedy") #adding geometry to the window tkobj.geometry("400x400") #creating a label sa = Label(tkobj,text="Welcome to Codespeedy") sa.grid(padx=(120,0),pady=(0,0)) sa.mainloop()