Skip to content

yibie/grid-table

Repository files navigation

English | ไธญๆ–‡

๐ŸŽฏ grid-table - Emacs Advanced Table System

figure

A native table system for Emacs! Supports rich text, formula calculation, and plugin extensions ๐Ÿ”ฅ

โœจ Features

Appearance Data Calculation Extensibility
Rich Text Rendering
Cell Images
Adaptive Column Widths
Unicode Borders
Formula Engine (Excel Style)
๐Ÿ“ Cell References
Real-time Calculation
Elisp Expressions
Plugin Architecture
๐Ÿ”— Multiple Data Sources
Format Export
๐Ÿ”ง Custom Extensions

๐Ÿš€ Core Capabilities

  • Markdown Style Markup - Write resume summaries in cells
  • Image Visualization - Display images directly in tables!
  • Excel-Level Formulas - =B2*C2ยท =SUM(A1:A10)ยท =IF(...)
  • Elisp Super Formulas - Powerful =elisp:(cell"A1") expressions
  • Real-time Preview - "Static Preview + Dynamic Editing" in Org/Markdown

๐Ÿš€ 30 Seconds to Get Started

๐Ÿ“ฆ 1. Installation and Configuration

๐ŸŽฏ Recommended: Use use-package

;; ๐Ÿš„ One-stop configuration - Recommended!
(use-package grid-table
  :load-path ("/path/to/grid-table" "/path/to/grid-table/plugins")
  :config
  (require 'grid-table)
  (require 'grid-table-plugins)
  
  ;; ๐Ÿ“ Custom save directory
  (setq grid-table-default-save-directory "~/Documents/่กจๆ ผ/")
  
  ;; ๐Ÿ–ผ๏ธ Image display optimization
  (setq grid-table-image-target-char-height 8)
  (setq grid-table-image-max-width-ratio 0.9))

๐Ÿ“‹ Traditional Way

;; ๐Ÿ“ Manual configuration path
(add-to-list 'load-path "/path/to/grid-table")
(add-to-list 'load-path "/path/to/grid-table/plugins")

;; ๐ŸŽฏ Load on demand
(require 'grid-table)          ;; Core functionality
(require 'grid-table-plugins)  ;; Plugin system
(require 'grid-table-csv)      ;; CSV support
(require 'grid-table-org)      ;; Org integration
(require 'grid-table-markdown) ;; Markdown integration

๐Ÿ“‹ Operation Quick Reference

File Operations Overview

๐ŸŽฏ Action ๐Ÿ“ Command ๐Ÿ”‘ Shortcut โšก Tip
New M-x grid-table-create - Create a blank table
Open M-x grid-table-find-file C-c C-f Open .grid file
Save - C-c C-w Smart path suggestion
CSV M-x grid-table-find-file-csv - Directly read CSV

Editing Operations Quick Reference

๐ŸŽฏ Action ๐Ÿคž Shortcut ๐Ÿ“ Effect โš ๏ธ Note
โœ๏ธ Basic Editing
Cell Editing e or right-click Enter edit mode Cell focus
Title Editing C-c t Modify table title Global display
โž• Row Operations
Insert Row Below C-c r a Create new row below current row Smart format inheritance
Delete Current Row C-c r d Delete entire row โš ๏ธ Table headers cannot be deleted
โž• Column Operations
Insert Column to Right C-c c a Create new blank column Auto-adjust width
Delete Current Column C-c c d Delete entire column Clear data

Navigation Control Diagram

๐ŸŽฏ Direction โŒจ๏ธ Key ๐Ÿ–ฑ๏ธ Operation
โฌ†๏ธ Up p or โ†‘ Previous row
โฌ‡๏ธ Down n or โ†“ Next row
โฌ…๏ธ Left S-TAB or โ† Left cell
โžก๏ธ Right TAB or โ†’ Right cell
๐Ÿ”„ Refresh g Re-render

๐ŸŽฏ Tip: Use n/p for vertical movement, TAB for horizontal movement

๐Ÿงฎ Formula Complete Guide

Basic Syntax Comparison Table

๐ŸŽฏ Type ๐Ÿ“ Syntax ๐Ÿ“‹ Example ๐Ÿ’ก Description
๐Ÿ“ Cell =A1ใ€=B2 =B2*C2 Relative reference
๐Ÿ“Š Range =RANGE(A1:B5) =SUM(A1:A10) Continuous block
โœจ Function =FUNCTION(args) =AVERAGE(B2:B10) Built-in function set

Official Built-in Function List

๐Ÿ“ˆ Math Functions ๐Ÿ“Š Statistical Functions ๐ŸŽฏ Conditional Functions ๐ŸŽจ Text Functions
SUM Sum AVERAGE Average IF Conditional CONCAT Concatenate
PRODUCT Product COUNT Count AND/OR Logical LEFT/RIGHT Slice
MOD Modulus MAX/MIN Extremes NOT Invert LEN Length

Elisp Formula Advanced Techniques (Expert Level)

=elisp:(+ 1 2 3)                      ; ๐ŸŽฏ Basic calculation
=elisp:(+ (cell "A1") (cell "B2"))     ; ๐Ÿ“ Cell reference
=elisp:(format "%.2f%%" (* 100 (cell "ๅฎŒๆˆ็އ"))) ; ๐ŸŽจ Formatted string
=elisp:(let ((x (cell "B2"))) (* x x)) ; ๐Ÿ”ง Complex logic

This feature is turned off by default. For more detailed guidance, please refer to ELISP_FORMULA_GUIDE.md.

โš ๏ธ Security Warning: =elisp: executes arbitrary Elisp code! Only use in fully trusted documents
๐Ÿ”’ Suggestion: Verify external files are safe and reliable through M-x checkdoc

๐Ÿ”— Format Integration Guide

Org Mode Deep Integration

#+BEGIN: grid-table
#+OPTIONS: :file "~/project/data.grid" 

here display table preview (static preview)

#+END:

three steps:

  1. M-x grid-table-org-insert-block - insert grid-table block (static preview)
  2. M-x grid-table-org-refresh-block - refresh grid-table block (dynamic preview)
  3. M-x grid-table-org-open-block - open grid-table block (edit mode)

Markdown GitHub-style

```grid-table
:file ~/project/data.grid

here display table preview (static preview)

reStructuredText support

๐ŸŽฏ scenario ๐Ÿ“ command ๐Ÿ“ค result
from grid export M-x grid-table-export-as-rst ๐Ÿ“„ standard RST format
insert existing grid file M-x grid-table-rst-insert-table-from-file ๐Ÿ”— smart path recognition

Core Technology Principles

Data Flow Architecture Diagram

็”จๆˆท็•Œ้ข โ†โ†’ grid-table.el โ†โ†’ ๆ ธๅฟƒๅผ•ๆ“Ž
                โ†“                โ†“
          data-source API โ† grid-data-model
                โ†“                โ†“
        CSVๆ’ไปถ โ†โ†’ Orgๆ’ไปถ โ†โ†’ ่‡ชๅฎšไน‰ๆ•ฐๆฎๆบ

Core API Quick Reference Table

๐Ÿค interface type ๐Ÿ”— key ๐Ÿ“ return value type ๐Ÿ’ก key purpose
data acquisition
raw value :get-raw-value-at String value before formula
computed value :get-computed-value-at Any formula calculation result
structure management
dimension query :get-row-count Integer import data statistics
new unit :add-row / :add-column Boolean success/failure
extension interface
load interface :load-from-file Object custom file support
save interface :save-to-file Boolean format export logic

๐Ÿ“ code organization structure

grid-table/                    # project root directory
โ”œโ”€โ”€ grid-table.el              # main entry + UI rendering
โ”œโ”€โ”€ grid-data-model.el         # data model core
โ”œโ”€โ”€ grid-data-source.el        # data source abstraction
โ”œโ”€โ”€ grid-table-api.el          # public API
โ”œโ”€โ”€ grid-table-calc.el         # formula calculation engine
โ”œโ”€โ”€ grid-table-nav.el          # navigation control logic
โ”œโ”€โ”€ grid-table-parser.el       # text parsing tool
โ””โ”€โ”€ grid-table-persistence.el  # persistence support
โ”œโ”€โ”€ plugins/                   # plugin extension system
โ”‚   โ”œโ”€โ”€ grid-table-csv.el      # CSV format support
โ”‚   โ”œโ”€โ”€ grid-table-org.el      # Org mode integration
โ”‚   โ”œโ”€โ”€ grid-table-markdown.el # Markdown integration
โ”‚   โ”œโ”€โ”€ grid-table-rst.el      # reStructuredText export
โ”‚   โ””โ”€โ”€ grid-table-example-plugin.el # plugin development example
โ”œโ”€โ”€ docs/                      # technical documentation
โ”‚   โ”œโ”€โ”€ ELISP_FORMULA_GUIDE.md     # formula development guide
โ”‚   โ””โ”€โ”€ PLUGIN_DEVELOPMENT.md      # plugin development manual
โ””โ”€โ”€ pictures/                  # product screenshots and demonstrations

๐Ÿค how to contribute

โšก plugin development quick start

3 types of plugins (1 minute to master)

๐ŸŽฏ type ๐Ÿ“ function description ๐ŸŽฏ applicable scenario
๐ŸŽจ cell renderer custom cell display appearance progress bar, currency format, etc.
๐Ÿ“Š data source plugin support new file formats JSON, Excel reading
โšก function plugin add new function commands data export, chart generation

quick start template (copy and use)

;;; my-plugin.el --- quick template -*- lexical-binding: t -*-
(require 'grid-table-plugins)

;; simple currency formatter
(defun my-currency-renderer (value &optional cell-props)
  "Currency formatter, convert number to ยฅXX.XX format"
  (if (and value (stringp value))
      (let ((num (string-to-number value)))
        (format "ยฅ%.2f" num))
    ""))

;; register renderer (done!)  
(defun my-plugin-init ()
  (grid-table-register-cell-renderer 'currency #'my-currency-renderer)
  (grid-table-register-plugin 'my-plugin))

(my-plugin-init)
(provide 'my-plugin)

๐Ÿ“š complete development guideโ†’ plugin development manual (fromๅ…ฅ้—จ to expert level)

๐Ÿ› quick feedback path

๐ŸŽฏ community contribution direction

๐ŸŽฏ type ๐Ÿ“‹ demand description ๐Ÿท๏ธ tag
data source plugin Excel/JSON/Multiple data sources enhancement, plugin
format export LaTeX/ASCII/HTML/JSON export extending, format
theme plugin dark mode UI/UX, theme
chart plugin data visualization visualization

Built with โค๏ธ for the Emacs community

Since 2025, supporting efficient productivity workflows

๐Ÿค โ†’ Join the developer community โ†

About

A native table system for Emacs! Supports rich text, formula calculation, and plugin extensions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •