BSD 4_3 release
[unix-history] / usr / doc / usd / 25.trofftut / tt05
CommitLineData
95f51977 1.\" @(#)tt05 6.1 (Berkeley) 5/23/86
aa4faf0e
KD
2.\"
3.NH
4Tabs
5.PP
6Tabs
7(the \s8ASCII\s0 `horizontal tab' character)
8can be used to produce output in columns,
9or to set the horizontal position of output.
10Typically
11tabs are used only in unfilled text.
12Tab stops are set by default every half inch from the
13current indent,
14but
15can be changed by the
16.BD .ta
17command.
18To set stops every inch, for example,
19.P1
20^ta 1i 2i 3i 4i 5i 6i
21.P2
22.PP
23Unfortunately the stops are left-justified only
24(as on a typewriter),
25so lining up columns of right-justified numbers can be painful.
26If you have many numbers,
27or if you need more complicated table layout,
28.ul
29don't
30use
31.UL troff
32directly;
33use the
34.UL tbl
35program described in [3].
36.PP
37For a handful of numeric columns, you can do it this way:
38Precede every number by enough blanks to make it line up
39when typed.
40.P1
41^nf
42^ta 1i 2i 3i
43\0\01\0\fItab\fR\0\0\02\0\fItab\fR\0\0\03
44\040\0\fItab\fR\0\050\0\fItab\fR\0\060
45700\0\fItab\fR\0800\0\fItab\fR\0900
46^fi
47.P2
48Then change each leading blank into the string
49.BD \e0 .
50This is a character that does not print, but that has
51the same width as a digit.
52When printed, this will produce
53.P1
54.ta 1i 2i 3i
55\0\01 \0\02 \0\03
56\040 \050 \060
57700 800 900
58.P2
59.PP
60It is also possible to fill up tabbed-over space with
61some character other than blanks by setting the `tab replacement character'
62with the
63.BD .tc
64command:
65.P1
66^ta 1.5i 2.5i
67^tc \e(ru (\e(ru is "\(ru")
68Name \fItab\fR Age \fItab\fR
69.P2
70produces
71.P1 3
72.ta 1.5i 2.5i
73.tc \(ru
74Name Age
75.tc
76.P2
77To reset the tab replacement character to a blank, use
78.BD .tc
79with no argument.
80(Lines can also be drawn with the
81.BD \el
82command, described in Section 6.)
83.PP
84.UL troff
85also provides a very general mechanism called `fields'
86for setting up complicated columns.
87(This is used by
88.UL tbl ).
89We will not go into it in this paper.