title: How do I center widgets placed by `tkinter.grid` in Python?
body: <p>I have a GUI. On this I have <code>grid</code>ed many widgets. But the problem is that the widgets placed by gridding always are at the top left. I want them at the center of the screen while still retaining placing them by the <code>grid</code> method. How do I do that? Here's my code:</p>
  
  <pre><code>    self.frame = tkinter.Frame()
  
      tkinter.Label(self.frame, text=(name+' By '+coordinator), font=('Calibri', 24)).grid(row=1,column=1,columnspan=4)
  
      self.tree = tkinter.ttk.Treeview(self.frame)
      self.tree.grid(row=2, column=1, rowspan=8, padx=4, pady=4, ipadx=4, ipady=4)
  
      tkinter.ttk.Label(self.frame, text='ID:').grid(row=4, column=2)
      self.id = tkinter.ttk.Entry(self.frame, width=3)
      self.id.grid(row=5, column=2, padx=4)
  
      tkinter.ttk.Label(self.frame, text='Points:').grid(row=4, column=3)
      self.marks = tkinter.ttk.Entry(self.frame, width=2)
      self.marks.grid(row=5, column=3, padx=4)
  
      self.submit = tkinter.ttk.Button(self.frame, text='Submit')
      self.submit.grid(row=5, column=4, padx=4)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/YJfbj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YJfbj.png" alt="enter image description here"></a></p>
  
  <p>Thanks.</p>