Alex Rivera | Logout

Which widget do you use for a Excel like table in tkinter?

Asked 2011-08-26T18:19:22.140
14

I want a Excel like table widget in tkinter for a gui I am writing. Do you have any suggestions?

Edit
Report

1 Answer

9

Tktable is at least arguably the best option, if you need full table support. Briefly, the following example shows how to use it assuming you have it installed. The example is for python3, but for python2 you only need to change the import statement.

import tkinter as tk
import tktable

root = tk.Tk()
table = tktable.Table(root, rows=10, cols=4)
table.pack(side="top", fill="both", expand=True)
root.mainloop()

Tktable can be difficult to install since there is no pip-installable package.

If all you really need is a grid of widgets for displaying and editing data, you can easily build a grid of entry or label widgets. For an example, see this answer to the question Python. GUI(input and output matrices)?

answered 2011-08-26T19:21:13.570

Your Answer