(BSD System Compatibility)
tbl(1bsd)
tbl --
(BSD) format tables for nroff or troff
Synopsis
/usr/ucb/tbl [-me] [-ms] [-TX] [file] . . .
Description
The
tbl
command is a preprocessor for formatting tables for
nroff
or
troff.
The input
files
are copied to the standard output, except that lines
between .TS
and .TE
command lines are assumed to describe tables
and are reformatted.
If no arguments are given,
tbl
reads the standard input, so
tbl
may be used as a filter.
When
tbl
is used with
eqn
or
neqn
the
tbl
command should be first, to minimize the
volume of data passed through pipes.
-me-
This option copies the -me
macro package to the front of the output file.
-ms-
This option copies the -ms
macro package to the front of the output file.
-TX-
This option produces output that does not have fractional line motions
in it.
Options
The following options must be placed immediately after the .TS
line.
Each option must be separated by a space, tab or comma and must
end with a semicolon.
center-
centers the table (default is left-justified)
expand-
makes the table as wide as current line length
box-
encloses the table in a box
allbox-
encloses each data entry of the table in a box
tab(x)-
separates data entries by using x instead of tab
Format
The format section of the table specifies the layout of the columns.
Each line in the format section corresponds to one line of
table data except the last line, which corresponds to all succeeding
data lines.
Each line contains a key-letter for each column of the table.
A dot (.) indicates the end of key letters.
l-
specifies a left-justified column entry
r-
specifies a right-justified column entry
c-
specifies a centered column entry
n-
specifies a numerical column entry
s-
specifies a spanned heading
w(n)-
w following a key-letter specifies a column width
References
eqn(1bsd),
nroff(1bsd),
troff(1bsd)
Examples
Data entries are usually separated by tabs,
but in the following examples,
a colon (:) is used as the tab character.
Input
.TS
tab(:);
c s s
c c s
c c c
l n n.
Household Population
Town:Households
:Number:Size
Bedminster:789:3.26
Bernards Twp.:3087:3.74
Bernardsville:2018:3.30
.TE
Output
Household Population
Town Households
Number Size
Bedminster 789 3.26
Bernards Twp. 3087 3.74
Bernardsville 2018 3.30
To include a block of text as a data entry, precede it by
T{ and follow it by T} as in the following example:
Input
.TS
allbox tab(:);
c s s
c c c
l lw(1.5i) lw(1.5i).
New York Area Rocks
Era:Formation:Age (years)
Mesozoic:T{
Newark Basin, including
Stockton, Lockatong, and
Brunswick formations; also
Watchungs and Palisades
T}:200 million
Cenozoic:Coastal Plain:T{
On Long Island 30,000 years;
Cretaceous sediments redeposited
by recent glaciation
T}
.TE
Output
+---------------------------------------------+
| New York Area Rocks |
+---------+-----------------+-----------------+
| Era | Formation | Age (years) |
+---------+-----------------+-----------------+
|Mesozoic | Newark Basin, | 200 million |
| | including | |
| | Stockton, | |
| | Lockatong, and | |
| | Brunswick | |
| | formations; | |
| | also Watchungs | |
| | and Palisades | |
+---------+-----------------+-----------------+
|Cenozoic | Coastal Plain | On Long Island |
| | | 30,000 years; |
| | | Cretaceous |
| | | sediments |
| | | redeposited by |
| | | recent |
| | | glaciation |
+---------+-----------------+-----------------+
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004