title: How To Create Frame With Two Columns of Labels using Python and Tkinter?
body: <p>I would like to create a table of n rows and 2 columns with a header. I am aware of TkinterTreeCtrl but do not want to use it. I read up on the grid manager and wrote some sample code but it does not at all do what I want it.</p>
  
  <p>Firstly, it shows two rows instead of two columns.
  Secondly, when I comment out the line <code>self.sensorTable.pack()</code> I expect to see only the quit button because the two labels were slaves of the columns which in turn were slaves of the sensorTable.</p>
  
  <pre><code>from Tkinter import *
  
  
  class Window:
  
      def __init__(self):
          self.root = Tk()
  
          self.sensorTable = Frame(master=self.root)
          self.sensorNameColumn = LabelFrame(self.sensorTable, text="Name", padx=5, pady=5).grid(row = 0, column = 0)
          self.sensorValueColumn = LabelFrame(self.sensorTable, text="Value", padx=5, pady=5).grid(row = 0, column = 1)
  
          w = Label(master=self.sensorNameColumn, text="Hello")
          w.pack()
  
          w2 = Label(master=self.sensorValueColumn, text="World")
          w2.pack()
  
          #self.sensorTable.pack() # commenting this out should mean that the two entries are not seen on the window but they are for some reason
  
          quit_button = Button(self.root, text="Quit", command=self.quit)
          quit_button.pack(side=BOTTOM)
  
      def begin(self):
          mainloop()
  
      def quit(self):
          self.root.quit()     # stops mainloop
          self.root.destroy()
  
  
  if __name__=="__main__":
      Window().begin()
  </code></pre>