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