title: How to view partial area of a treeview and horizontal scrollable in tkinter?
body: <p>I have a table created by tk.treeview, for example, there're 10 columns. The target is to build a treeview widget with horizontal scrollbar, the view width of widget is set just about 4 columns and use horizontal scrollbar to view other columns.</p>
  <p>Using tk.Frame as parent widget and with scrollbar, vertical scroll will hide the header, so not use it.</p>
  <p>Platform: WIN 10
  Python: 3.8.6
  tkinter: 8.6</p>
  <pre class="lang-py prettyprint-override"><code>import tkinter as tk
  from tkinter import ttk
  
  root = tk.Tk()
  
  # root.columnconfigure(0, weight=1)
  # root.rowconfigure(0, weight=1)
  
  columns = [f'Column {i}' for i in range(10)]
  
  x_scrollbar = tk.Scrollbar(root, orient=tk.HORIZONTAL)
  x_scrollbar.grid(row=1, column=0, sticky=tk.E+tk.W)
  y_scrollbar = tk.Scrollbar(root, orient=tk.VERTICAL)
  y_scrollbar.grid(row=0, column=1, sticky=tk.N+tk.S)
  
  tree = ttk.Treeview(root, columns=columns, height=10, show=&quot;headings&quot;,
      xscrollcommand=x_scrollbar.set, yscrollcommand=y_scrollbar.set)
  tree.grid(row=0, column=0, sticky=tk.N+tk.S+tk.E+tk.W)
  
  for col in tree['columns']:
          tree.heading(col, text=f&quot;{col}&quot;, anchor=tk.CENTER)
          tree.column(col, anchor=tk.CENTER, width=100)
  
  for i in range(100):
      tree.insert('', 'end', values=[i*10+j for j in range(len(columns))])
  
  x_scrollbar['command'] = tree.xview
  y_scrollbar['command'] = tree.yview
  
  root.mainloop()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/AJCn8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AJCn8.png" alt="enter image description here" /></a></p>
  <p>The question is how can I set the view width just about 4 columns and with horizontal scrollbar work ? like this ! (no windiw resize)</p>
  <p><a href="https://i.stack.imgur.com/FCKAs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FCKAs.png" alt="enter image description here" /></a></p>