# How to add space between two widgets placed in a grid in tkinter?

TkinterServer Side ProgrammingProgramming

#### Mastering Python GUI with Tkinter

16 Lectures 2 hours

#### GUI Programming with Python Tkinter and Java Swing

30 Lectures 3.5 hours

#### Build A Paint Program With TKinter and Python

24 Lectures 1.5 hours

Let us assume that we are creating a tkinter application where two or more widgets are placed using a grid property. We have to add some space between the widgets in order to style their appearance. To provide space in the widgets, we can use padding property, as padding adds space to the outermost part of the widget. In order to add padding, assign the values to padx and pady.

## Example

#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, padx= 25, pady= 25)
win.mainloop()