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

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

Re: rcd-box.el for box drawings and tables


From: Heime
Subject: Re: rcd-box.el for box drawings and tables
Date: Tue, 08 Nov 2022 07:58:02 +0000

------- Original Message -------
On Tuesday, November 8th, 2022 at 6:39 AM, Jean Louis <bugs@gnu.support> wrote:


> 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 ║
> ╚══════════════════╝
> 
> "

You should consider the possibility when someone does not want a separator 
between rows.
For instance I did like the idea of introducing a separator with "|--\n")



reply via email to

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