File: tbl_alig

package info (click to toggle)
lout 3.12-0.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 8,376 kB
  • ctags: 2,428
  • sloc: ansic: 25,182; makefile: 261; sh: 60
file content (58 lines) | stat: -rw-r--r-- 1,510 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@Section
   @Title { Aligned columns }
   @Tag { aligned }
@Begin
@PP
Columns of numbers are often presented with decimal points aligned:
aligned. @Index { aligned columns in tables }
@CD @Tab
    @Fmta { @Col A }
{
    @Rowa A { 5^.46 }
    @Rowa A { 3^.4159 }
    @Rowa A { 5772^ }
}
You can produce this by placing a @Code "^" symbol just before the
alignment point in each entry:
@ID @OneRow @Code {
"@Tab"
"    @Fmta { @Col A }"
"{"
"    @Rowa A { 5^.46 }"
"    @Rowa A { 3^.4159 }"
"    @Rowa A { 5772^ }"
"}"
}
The equals signs of equations can be aligned in the same way.  The
format of such columns should not contain @Code "@CC" or {@Code "@RR"}.
@PP
The simplest way to get a heading over an aligned column is to use the
@Code "^" symbol in the heading as well.  If it is not possible to do
this, for example because the heading entry is a paragraph of text
broken over more than one line, the most viable alternative is to use
@Code "@Over" in the heading line's format to make the heading column
span over the aligned column:
@ID @OneRow @Code {
"@Tab"
"    @Fmta { @Col @CC H @Over A }"
"    @Fmtb { @Col A }"
"{"
"    @Rowa H { Heading }"
"    @Rowb A { 5^.46 }"
"    @Rowb A { 3^.4159 }"
"    @Rowb A { 5772^ }"
"}"
}
for example produces
@CD @Tab
    @Fmta { @Col @CC H @Over A }
    @Fmtb { @Col A }
{
    @Rowa H { Heading }
    @Rowb A { 5^.46 }
    @Rowb A { 3^.4159 }
    @Rowb A { 5772^ }
}
Unfortunately, the aligned entries are left-justified in the column,
not centred.
@End @Section