
17.1.3 Examples of Formatting Tables
(defun example4 (&optional (items *alphabet*)
&key (stream *standard-output*) n-columns n-rows
inter-row-spacing inter-column-spacing
max-width max-height)
(clim:formatting-item-list
(stream :inter-row-spacing inter-row-spacing
:inter-column-spacing inter-column-spacing
:n-columns n-columns :n-rows n-rows
:max-width max-width :max-height max-height)
(do ()
((null items))
(clim:formatting-cell (stream)
(format stream "~A" (pop items))))))
Evaluating(example4 :stream *my-window*) shows this table:
A B C D
E F G H
I J K L
M N O P
Q R S T
U V W X
Y Z
Figure 29. Example4 Table You can easily add a constraint specifying the number of columns.
Evaluating(example4 :stream *my-stream* :n-columns 8) gives this:
A B C D E F G H
I J K L M N O P
Q R S T U V W X
Y Z
Figure 30. Example4 Table Reformatted

Generated with Harlequin WebMaker