This library allows you to put text data into boxes and align them horizontally, applying margin, padding, borders.
A snippet from grid-examples.el. Evaluate it in a buffer at the first character of some line:
(grid-insert-content
`(((:content ,grid-multiline-str :width 10 :border t :padding 1)
(:content ,grid-lipsum-2 :width "33%" :padding 2)
(:content ,grid-lipsum :width "33%" :padding 3))
((:content ,grid-multiline-str :width "49%" :border t :padding 1)
(:content ,grid-lipsum :width "49%" :border t :padding 10))))
Result:
You can wrap into a box any text you want. Any text properties will be saved. For example, this is a combination of light-dashboard and some other text:
(grid-insert-content
`(((:content ,grid-calendar :width 24 :border t :padding 1)
(:content ,light-dashboard-dashboard-string :width 40)
(:content ,grid-lipsum :width 40 :border 1 :padding 1))))
Result:
grid-insert-box
(grid-insert-box BOX)
grid-insert-rows
(grid-insert-rows '(ROW ROW ...))
;; ROW: '(BOX BOX ...)
grid-insert-row
(grid-insert-row ROW)
;; ROW: '(BOX BOX ...)
grid-insert-column
(grid-insert-column COLUMN)
;; COLUMN: '(BOX BOX ...)
grid-get-box
grid-get-column
grid-get-row
grid-get-rows
BOX formats:
- string. In that case the width of the box will be equal to the longest line in the string.
- plist. Properties:
:content - string to be inserted in the box
Optional:
:align center left (default) right
:width “50%” integer (number of characters)
:border nil or t
:padding - horizontal padding integer (number of characters)