Did you know ... Search Documentation:
Pack weblog -- prolog/formatting/wl_table.pl
PublicShow source

These are oriented towards presenting tables of data, not towards controlling layout

 wl_direct_table(+Data:listoflists)// is semidet
Given a list, each of whose members is either a list or a term head(List), outputs an HTML table representing the data.

Upon encountering a head(List) term the elements of List are output in th tags.

Bare lists are output as td tags

fails silently if it can't parse the data

The generated html sets the class of body rows to even or odd alternately to allow alternate row styling

 wl_table(+DataGen:goal, +OptionListIn:list)// is semidet
Generate a table from a predicate that supplies the data as alternate solutions.

DataGen is expected to be an arity 3 predicate my_data_gen(Key, Column, Value)

wl_table outputs an HTML table showing the data for all possible solutions to Key, Column

Note that if you want the keys you'll have to make sure the key is included as a column name.

Example, where my_key is the name of the primary key and my_data/3 is the underlying data.

...
\wl_table(table_cells, [])
...


table_cells(Key, my_key, Key) :-
      my_data(Key, _, _).
table_cells(Key, Column, Value) :-
      my_data(Key, Column, Value).

The generated html sets the class of body rows to even or odd alternately to allow alternate row styling

fails silently if given invalid arguments

Options:

header(:Goal)
Goal is expected to be an arity 2 predicate goal(Column, Label) if the option is missing, the column ID's are used as labels. if the option header(none) is provided, no headers are produced Note that you'll have to specify the module explicitly
columns(+List)
List is a list of column names. If this option exists, the columns in the list are displayed in the order given. Unless this list includes the key, it won't be included
rows(+List)
List is a list of row names. If this option exists, the rows in the list are displayed in the order given.