Search code examples
pythontkinter

Does tkinter have a table widget?


I'm learning Python, and I would like to use it to create a simple GUI application, and since Tkinter is already built-in (and very simple to use) I would like to use it to build my application.

I would like to make an app that will display a table that contains some data that I've loaded from my database.

I've searched for table but have not been able to find any examples and / or documentation regarding a Tkinter table component.

Does Tkinter have a built in table component? If not, what could I / should I use instead?


Solution

  • Tkinter doesn't have a built-in table widget. The closest you can use is a Listbox or a Treeview of the tkinter's sub package ttk.

    However, you can use tktable, which is a wrapper around the Tcl/Tk TkTable widget, written by Guilherme Polo. Note: to use this wrapper library you need first to have installed the original Tk's TkTable library, otherwise you will get an "import error".