Did you know ... | Search Documentation: |
Pack clitable -- README.md |
Pretty unicode tables for the CLI with Prolog.
This pack is available from the add-on registry of SWI-Prolog.
It can be installed with pack_install/1:
?- pack_install(clitable).
This module exports the two predicates clitable(+Data)
and clitable(+Data,+Options)
.
:- use_module(library(clitable)). ?- Data = [[a,bb,ccc], [111,22,3]], clitable(Data). âââââââ¤âââââ¤ââââââ â a â bb â ccc â â 111 â 22 â 3 â âââââââ§âââââ§ââââââ ?- Data = [[a,bb,ccc], [111,22,3]], Head = ['First', 'Second', 'Third'], clitable(Data, [head(Head)]). âââââââââ¤âââââââââ¤ââââââââ â First â Second â Third â âââââââââ¼âââââââââ¼âââââââ⢠â a â bb â ccc â â 111 â 22 â 3 â âââââââââ§âââââââââ§ââââââââ
The style can be changed by setting the appropriate chars in the Options list. The following defaults can be overridden by specifying the corresponding options:
top('â'), top_left('â'), top_mid('â¤'), top_right('â'), bottom('â'), bottom_left('â'), bottom_mid('â§'), bottom_right('â'), space(' '), left('â'), mid('â'), right('â'), mid_space('â'), mid_left('â'), mid_mid('â¼'), mid_right('â¢')