This WebMake Perl library provides the wwwtable tag. This is a useful way
to lay out HTML tables, using an more intuitive addressing system: instead of
listing all table entries, one by one, left to right and top to bottom, it
allows you to randomly, and flexibly, pick cells and define what goes into
them.
It's currently implemented using Tomasz Wegrzanowski's freetable package.
This package must be installed for this tag to be used; it can be downloaded
from
HTML is great language, but have one horrible flaw :
tables. I spent many hours looking at HTML source I just written
and trying to guess which cell in source is which in browser.
If this also describes you, then read this manpage and your
pain will stop.
Program read HTML source from either stdin or file (WebMake note: the HTML
source is read from between the <wwwtable> tags in the WebMake
content). Then it searches for line starting table:
<wwwtable [options]>
Then it analyzes table, put correct HTML table in this place and
continue searching for the next table.
wwwtable_options will be passed to <table> tags. There is
no magic inside preamble. It can be any HTML text. It will be simply
put in front of table.
cell is either normal_cell (<td> tag) or
header_cell (<th> tag).
At least it was this way in freetable 1.x.
See the next section for alternative cell address syntax.
cell_options will be passed to cell tag. There is magic inside
colspan and rowspan keys are parsed to make correct table.
cell_content can be anything. It may contain text, tags, and
even nested wwwtables.
row and col are either numbers locating cells, expressions relative to previous
cell or regular expresions to match few of them. Unlike wwwtable,
freetable can use regular expresions for header cells. Also * can be
used, and it mean .* really.
Relative expressions are :
= or empty means : the same as previous
+ or +X means : one and X more than previous
- or -X means : one and X less than previous
If many definisions adress the same cell all options and contents are
concatenated in order of apperance.
If you want to use only regular expresions you must tell
program about the last cell :
<wwwtable>
(*,1)
these are colums 1
(1,*)
these are rows 1
(4,4)
</wwwtable>
It is inconvenient to specify cell address as regular expression.
So in freetable 2.0 two new methods were introduced.
Both can be used to either normal or header cells.
Full bakward compatibility is preserved.
To preserve it, new syntax had to be introduced.
Unfortunatelly, you can't specify row
address using one method, and column address using another.
To come around this, both new methods are very liberal
and allow you to use =, +, -, +X-X and null
string with the same meaning as they have in old addressing
method.
Unlike regular expression method,
new methods will find out the last cell automatically.
Syntax for both rowrange and colrange is like: 1-2,4-7,9,12.
Duplicates will be eliminated. For purpose of relative addresses
last given number is used. So if you write
(1-100,32;1)
foo
(+,)
bar
Cell (33,1) will contain `foobar' and all others only `foo'.
({code for rows},{code for tables}) cell_options
cell_content
You can use arbitrary Perl one-liner as long as it matches our
not very intelligent regular expressions and evaluates to list.
Unfortunatelly there isn't any regular expression for Perl code,
but as long as it doesn't contain },{ and }) it should work.
Example:
Will evaluate to 100 rows x 4 columns table with `foo' in
every 1st, 2nd and 4th column of every row with number equal 1 modulo 3.
If you want to use ``arbitrary code'' in one part of address and
explicit range in the other, change - into .. in defenition of
range, and put in between { and }.
If you want to use ``arbitrary code'' in one part of address and
regular expression in the other, you have to write
{grep {/expression/} from..to}.
Unfortunatelly, in this case you have to specify size of the table explicitely.
If you was formerly user of wwwtable and want to change your tool, you
should read this. Most of this is about regexps handling.
Notice also that wwwtable couldnt do location tags substitution nor macroprocesing.
Option -w has completely oposite meaning. We dont print warnings by default,
and -w or --warning is used to force warnings.
Table header fields can be specified by regexps ex :
((1,*))
It was impossible in wwwtable.
Axis counters are 100% orthogonal. This mean that code :