A Simple Solution to easily use tables in any Tkinter Application
Project description
tktable
tktable is a Python library designed to simplify the creation of beautiful tables in Tkinter GUI applications.
Introduction
Developers using Tkinter often find creating tables natively to be challenging and time-consuming. Importing ttk.TreeView and writing numerous lines of unnecessary code is a common frustration. tktable offers a solution, allowing you to create attractive tables with just a few lines of code, enhancing the simplicity and ease of Python development.
Installation
Installing tktable is straightforward. Simply execute the following pip command:
pip install tktable
Usage
Using tktable is intuitive and requires just a few steps.
Step 1
Import the Table class from the tktable package:
from tktable import Table
Step 2
Create an instance of the Table class and provide the necessary arguments:
table_headers = ("Name", "Age", "Email")
mytable = Table(root, table_headers)
mytable.pack()
Step 3
Insert rows into the created table:
row1 = ("Jack", 12, "jack@gmail.com")
mytable.insert_row(row1)
row2 = ("John", 15, "john@gmail.com")
mytable.insert_row(row2)
Customization Options
Enhance the appearance of your table by customizing it with optional arguments in the Table class constructor.
For example, to make the headers bold:
mytable = Table(root, table_headers, headings_bold=True)
Adjust column width:
mytable = Table(root, table_headers, col_width=100)
Change the font size of the table content:
mytable = Table(root, table_headers, font_size=12)
Modify the font face of the table content:
mytable = Table(root, table_headers, font_face="Times New Roman")
Stay tuned for additional customization options in future releases!
Sample Application
import tkinter as tk
from tktable import Table
root = tk.Tk()
root.geometry("800x400")
table_headers = ("Name", "Age", "Email")
mytable = Table(root, table_headers, col_width=150, headings_bold=True)
mytable.pack(pady=100)
row = ("Nitin", 18, "ngarg@mail.com")
mytable.insert_row(row)
root.mainloop()
Contributions
Currently, the module's source code is not open-source. After publishing 2-3 more releases, we plan to open-source it. Stay tuned for updates!
Developer Info
Developed with great love by Nitin Garg.
Check out my GitHub for more exciting projects!
Thank you!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tktable-0.2.tar.gz.
File metadata
- Download URL: tktable-0.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76c263bcf64fa4820d6b09e6a6da145c7cebb239aa8e1e5785b7089da4e37cbf
|
|
| MD5 |
2e066e797d3d28dcf771f43dfd478d4a
|
|
| BLAKE2b-256 |
9a0f8e3585bf8c934ac4cfdd0c23ea49c18839672e49cb566dc7649490a9284b
|
File details
Details for the file tktable-0.2-py3-none-any.whl.
File metadata
- Download URL: tktable-0.2-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fecb4f4285b1d760a78c844e86caad781abd50fdb9ae7233279a35bda3567a53
|
|
| MD5 |
f620d5b3b1c7bbf5ac184fa6192afb3a
|
|
| BLAKE2b-256 |
d3b7ba0d82069d415d4658de88caba1b45cf10a2a28f2ef49db18a864e832bab
|