Skip to main content

CTkTable

Here is a quick and simple table widget having all the basic features.

Screenshot

Features:

  • Add columns/rows
  • Delete columns/rows
  • Edit rows/columns at once
  • Insert values to specific cell
  • delete values from specific cell
  • update all values at once
  • edit each cell value and options
  • entry editing
  • can be used with scrollable frame
  • Lots of other data operarions

Installation

pip install CTkTable

GitHub repo size

Usage

import customtkinter
from CTkTable import *

root = customtkinter.CTk()

value = [[1,2,3,4,5],
         [1,2,3,4,5],
         [1,2,3,4,5],
         [1,2,3,4,5],
         [1,2,3,4,5]]

table = CTkTable(master=root, row=5, column=5, values=value)
table.pack(expand=True, fill="both", padx=20, pady=20)

root.mainloop()

Methods

  • .insert(row, column, value, *args): change specific cell index data
  • .add_row(index, values)
  • .add_column(index, values)
  • .edit_row(row_num, *args): edit one full row at once
  • .edit_column(column_num, *args): edit one full column at once
  • .delete_row(index): remove one row
  • .delete_column(index): remove one column
  • .delete_rows(indices): remove mutliple rows
  • .delete_columns(indices): remove multiple columns
  • .edit(row, column): edit specific cell without changing the value
  • .select(row, column): select one cell
  • .select_row(row): select a row
  • .get_selected_row(): get the values of the selected row
  • .deselect_row(row): deselect a row
  • .select_column(column): select a column
  • .get_selected_column(): get the values of selected column
  • .deselect_column(column): deselect a column
  • .update_values(values): update all values at once
  • .delete(row, column, *args): delete the data from specific index
  • .get(): get all values
  • .get(row, column): get specific cell value
  • .get_row(row): get all values of a specific row
  • .get_column(column): get all values of a specific column
  • .configure(arguments): change other table attributes

here, args means ctkbutton parameters which can also be passed

Note: treat all the table cells as a ctkbutton class

Arguments

Parameter Description
master parent widget
values the default values for table
row optional, set number of default rows
column optional, set number of default columns
padx add internal padding in x
pady add internal padding in y
colors set two fg_colors for the table (list), eg: colors=["yellow", "green"]
color_phase set color phase based on rows or columns, eg: color_phase="vertical"
orientation change the orientation of table, vertical or horizontal
header_color define the topmost row color
corner_radius define the corner roundness of the table
hover_color enable hover effect on the cells
wraplength set the width of cell text
justify anchor the position of the cell text
command specify a command when a table cell is pressed, [returns row, column, value]
*other button parameters all other ctk button parameters can be passed

Note: This library is at early stage so there can be some performance issues.

Thanks for visiting! Hope it will help :)

Metadata

Release files for CTkTable 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for CTkTable 1.1
File Size Uploaded
CTkTable-1.1.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for CTkTable 1.1
File Interpreter ABI Platform
CTkTable-1.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.9 kB

Release files / CTkTable-1.1.tar.gz

Download URL CTkTable-1.1.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5c749124a888a17d129abb3d0afc9330c7dd5eb02e3bda8ffc6ff7b91461b076
BLAKE2b-256 checksum
How to use checksums
72177865e96995857a5056c51cc4997d2a2dadc06d8020079b922c6f6ed320a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.0

Release files / CTkTable-1.1-py3-none-any.whl

Download URL CTkTable-1.1-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2615004bfb138618001c8b5fbf32accbd0142098cae4fb98d3043ae4e29b4d1
BLAKE2b-256 checksum
How to use checksums
701a9dfddc895d7252ecb23546d9b1edbf3960b2aa37550deba8070b8fc3ba97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.0

Release history Release notifications | RSS feed

This release

1.1 This release

2 release files

1.0

2 release files

0.9

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page