Split line padding from table cell padding.
This commit is contained in:
parent
19daaf7706
commit
c0a8d6d2b3
1 changed files with 9 additions and 5 deletions
14
table.scm
14
table.scm
|
@ -136,6 +136,14 @@
|
||||||
rcws))
|
rcws))
|
||||||
rcws)))))
|
rcws)))))
|
||||||
|
|
||||||
|
;; Normalizes cell line to required width and handles leading and
|
||||||
|
;; trailing tabs to allow for right and center alignment.
|
||||||
|
(define (table-normalize-cell-line cs w)
|
||||||
|
(let ((csl (ansi-string-length cs)))
|
||||||
|
(if (< csl w)
|
||||||
|
(string-append cs (string-repeat " " (- w csl)))
|
||||||
|
cs)))
|
||||||
|
|
||||||
;; Pads all lines of this cell to required width
|
;; Pads all lines of this cell to required width
|
||||||
(define (table-normalize-cell c w)
|
(define (table-normalize-cell c w)
|
||||||
(let loop ((c c)
|
(let loop ((c c)
|
||||||
|
@ -143,11 +151,7 @@
|
||||||
(if (null? c)
|
(if (null? c)
|
||||||
(reverse r)
|
(reverse r)
|
||||||
(loop (cdr c)
|
(loop (cdr c)
|
||||||
(cons (let* ((cs (car c))
|
(cons (table-normalize-cell-line (car c) w)
|
||||||
(csl (ansi-string-length cs)))
|
|
||||||
(if (< csl w)
|
|
||||||
(string-append cs (string-repeat " " (- w csl)))
|
|
||||||
cs))
|
|
||||||
r)))))
|
r)))))
|
||||||
|
|
||||||
;; Returns a row (list) of cells (list of strings) with all strings
|
;; Returns a row (list) of cells (list of strings) with all strings
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue