Giter VIP home page Giter VIP logo

ctktable's Introduction

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

Installation

pip install CTkTable

GitHub repo size

Dont forget to leave a โญ

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

  • .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
  • .select(row, column): select one cell
  • .select_row(row): select a row
  • .deselect_row(row): deselect a row
  • .select_column(column): select a column
  • .deselect_column(column): deselect a column
  • .update_values(values): update all values at once
  • .insert(row, column, value, *args): change specific index data
  • .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
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 :)

ctktable's People

Contributors

akascape avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.