Metadata-Version: 2.4
Name: tkable
Version: 1.0.2
Summary: Simple and beginner-friendly table widget for Tkinter
Author-email: Abdullah Sameh <abdullah.sameh.101208@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/AbdullahSameh10/tkable
Project-URL: Issues, https://github.com/AbdullahSameh10/tkable/issues
Keywords: tkinter,table,gui,datatable,ui
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: User Interfaces
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

<h1 align="center">
  <img src="https://raw.githubusercontent.com/AbdullahSameh10/tkable/main/Tkable%20Logo.png" width="500">
</h1>

<p align="center">
  <img src="https://img.shields.io/badge/status-active-success" />
  <img src="https://img.shields.io/badge/license-MIT-blue" />
  <img src="https://img.shields.io/badge/version-1.0.0-purple" />
</p>

<p align="center">
  The simplest way to create tables in Tkinter for beginners :)
</p>

---

## ✨ Features

* Easy to use
* Insert rows or dictionaries
* Column sorting
* Alternating row colors
* Scrollable table

---

## 📦 Installation

```bash
pip install tkable
```

---

## 🚀 Quick Example

```python
from tkable import DataTable
import tkinter as tk

root = tk.Tk()

table = DataTable(root, ["Name", "Age", "City"])

table.load_data([
    ["Person 1", 20, "City 1"],
    ["Person 2", 22, "City 2"]
])

root.mainloop()
```

---

### 📸 Result

![Result Screenshot](https://raw.githubusercontent.com/AbdullahSameh10/tkable/main/Example%20Screenshot.jpg)

---

## 🔧 Customization Options

| Parameter            | Type  | Default                  | Description             |
| -------------------- | ----- | ------------------------ | ----------------------- |
| `header_bg`          | str   | `#2c3e50`                | Header background color |
| `header_fg`          | str   | `white`                  | Header text color       |
| `row_height`         | int   | `28`                     | Height of each row      |
| `font`               | tuple | `("Segoe UI", 10)`       | Font used in the table  |
| `alternating_colors` | tuple | `("#ffffff", "#f5f5f5")` | Row background colors   |

---

## 📦 API Reference

### `insert_row(*values)`

Add a new row to the table.

```python
table.insert_row("Person Name", 20, "City")
```

---

### `insert_dict(data: dict)`

Insert a row using a dictionary.

```python
table.insert_dict({
    "Name": "Person Name",
    "Age": 22,
    "City": "City"
})
```

---

### `load_data(data)`

Load multiple rows.

```python
table.load_data([
    ["Person 1", 20],
    ["Person 2", 22]
])
```

---

### `clear()`

Remove all rows.

```python
table.clear()
```

---

### `get_selected_row()`

Return selected row as dictionary.

```python
selected = table.get_selected_row()
```

---

> 💡 Tip: Use `insert_dict()` when working with forms for cleaner code.
