help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rcd-box.el for box drawings and tables


From: Jean Louis
Subject: rcd-box.el for box drawings and tables
Date: Tue, 8 Nov 2022 09:39:32 +0300
User-agent: Mutt/2.2.7+37 (a90f69b) (2022-09-02)

Here is my attempt to generate Unicode tables:
https://hyperscope.link/7/3/9/8/1/Emacs-Lisp-rcd-box-el-package-for-table-drawings-73981.html

(rcd-box-table '(("Transport to Makindye" 1 20.00)
                 ("Mobile charges" 1 2000))
               '("Description" "Quantity" "Subtotal")
               '("left" "center" "right")) ⇒ "
╔═══════════════════════╦═══════════════════════╦═══════════════════════╗
║ Description           ║       Quantity        ║              Subtotal ║
╠═══════════════════════╬═══════════════════════╬═══════════════════════╣
║ Transport to Makindye ║           1           ║                  20.0 ║
╠═══════════════════════╬═══════════════════════╬═══════════════════════╣
║ Mobile charges        ║           1           ║                  2000 ║
╚═══════════════════════╩═══════════════════════╩═══════════════════════╝

"

(rcd-box-table '((1 2 3))) ⇒ "
╔═══╦═══╦═══╗
║ 1 ║ 2 ║ 3 ║
╚═══╩═══╩═══╝

"

(rcd-box-table '((1 2 3 "Hello"))) ⇒ "
╔═══════╦═══════╦═══════╦═══════╗
║ 1     ║ 2     ║ 3     ║ Hello ║
╚═══════╩═══════╩═══════╩═══════╝

"

(rcd-box-table '((1 2 3 "Hello")) nil "center") ⇒ "
╔═══════╦═══════╦═══════╦═══════╗
║   1   ║   2   ║   3   ║ Hello ║
╚═══════╩═══════╩═══════╩═══════╝

"


(rcd-box-table '((1 2 3 "Hello")) nil '("left" "right" "right" "center")) ⇒ "
╔═══════╦═══════╦═══════╦═══════╗
║ 1     ║     2 ║     3 ║ Hello ║
╚═══════╩═══════╩═══════╩═══════╝

"

Major bug is that cell width is currently calculated by the
longest cell length. Later I will calculcate it by column.

I also wish to add the FOOTER option that may include functions
to calculate column values.

(rcd-box-table '(("Good bye for now"))) ⇒ "
╔══════════════════╗
║ Good bye for now ║
╚══════════════════╝

"

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]