home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
APPS
/
lout2.lzh
/
LOUT2
/
DOC
/
TR.TAB
/
s3
< prev
next >
Wrap
Text File
|
1994-01-25
|
3KB
|
80 lines
@Section
@Title { Changing the style of rows }
@Begin
@PP
Sometimes different rows need different formats, usually because they
are headings. Although this can be done with style-changing symbols in
the entries, it is probably better to use multiple format options:
@ID @Code {
"@Tab"
" @Fmta { @Col @Heading A ! @Col @Heading B }"
" @Fmtb { @Col @A ! @Col @CC B }"
"{"
" @Rowa A { Course } B { Enrolment }"
" @Rowb A { Software Engineering } B { 174 }"
" @Rowb A { Complexity Theory } B { 37 }"
"}"
}
has result
@CD {
@Tab
@Fmta { @Col @Heading A ! @Col @Heading B }
@Fmtb { @Col A ! @Col @CC B }
{
@Rowa A { Course } B { Enrolment }
@Rowb A { Software Engineering } B { 174 }
@Rowb A { Complexity Theory } B { 37 }
}
}
We have used the @Code "@Heading" symbol from the DocumentLayout package
just to prove that it can be done. Each row appears in the format of
the corresponding format option: @Code "@Rowa" rows in the format of
{@Code "@Fmta"}, @Code "@Rowb" rows in the format of {@Code "@Fmtb"},
and so on. There may be up to ten different format options, from
@Code "@Fmta" to {@Code "@Fmtj"}, and they may be used repeatedly and
in any order.
@PP
There is an @Code "@Over" symbol for constructing
{@I{spanning columns}}: columns that spread over two or more following
columns. For example, the Lout input
@ID @Code {
"@I @Tab"
" @Fmta { @Col @CC X @Over A,B ! @Col C }"
" @Fmtb { @Col A ! @Col B ! @Col C }"
"{"
" @Rowa X { X } C { C }"
" @Rowb A { A } B { B } C { C }"
"}"
}
produces the table
@CD {
@I @Tab
side { single }
@Fmta { @Col @CC X @Over A,B !! @Col C }
@Fmtb { @Col A !! @Col B !! @Col C }
{
@Rowa X { X } C { C }
above { single }
below { single }
@Rowb A { A } B { B } C { C }
below { single }
}
}
(We will see how to get the lines later.) The @Code "@Over" symbol
always comes directly after the column letter, and it is followed by one
or more letters separated by commas indicating which columns in the
following row this column is to span over.
@PP
With multiple row formats, especially those with spanning columns, it is
important to take care that each row is compatible with the one
preceding it, in the sense of having the same number of columns, taking
@Code "@Over" symbols into account. For example, two successive
@Code "@Rowa" rows would not be compatible in the example above, since
the second has only two columns but the first prepares the way for three.
@PP
Tab does not provide a way to have spanning columns underneath the columns
they span, so spanning columns are useful only for headings. This
restriction was made necessary by inadequacies in the
way that the Basser Lout interpreter handles spanning columns.
@End @Section