Formats tables for the nroff and troff commands.
tbl [ -TX ] [ -- ] [ File... | - ]
The tbl command is a preprocessor that formats tables for the nroff and troff commands. It reads one or more files. If no File parameter or - (minus sign) is specified as the last parameter, the command reads standard input by default. It copies the input unchanged to standard output, except for text between lines containing .TS and .TE. The tbl command reformats such text, which describes tables, without altering the .TS and .TE lines.
Depending on the target output device, the output formatted by the nroff command may need to be post-processed by the col command to produce correct output.
Note: To minimize the volume of data passed through pipelines, enter the tbl command first when using it with the eqn or neqn command.
The tbl command processes text that is displayed within the following format:
[ {.DS .DF} ] .TS Options ; Format . Data .TE [.DE]
To include short tables in an mm macro document, enclose them within the .DS (or .DF) and .DE macro pair.
Following are the available
global options for the input format:
Option | Purpose |
center or CENTER | Centers the line. |
expand or EXPAND | Expands to line length. |
box or BOX | Encloses in a box. |
allbox or ALLBOX | Boxes all entries. |
doublebox or DOUBLEBOX | Encloses in two boxes. |
tab(Character) or TAB(Character) | Changes the tab character to the Character value. |
linesize(Number) or LINESIZE(Number) | Makes all lines the thickness of the point size specified by the Number value. |
delim(XY) or DELIM(XY) | Recognizes the X and Y variables as eqn command delimiters. |
; | Denotes end of options. |
The Format variable in
the Input Format describes the format of text. Each format line (the
last of which must end with a period) describes all remaining lines of the
table. A single-key letter describes each column of each line of the
table. Follow this key letter with specifiers that determine the font
and point size of the corresponding item, indicate where vertical bars are to
appear between columns, and determine such things as column width and
intercolumn spacing. The following are the available key letters:
Handling data within the input
format, especially for tables, uses the following line commands:
T{...T} | Indicates text block, as follows: |
\_ | Writes short horizontal line. |
\RX | Repeats the X parameter value across a column. |
\^ | Indicates that above item spans downward into this row. |
.T& | Starts new format. |
.TS H, .TH, and .TE | Allows multi-page tables with column headings repeated on each page. (This is a feature of the mm macros.) |
File | Specifies the files that the tbl command will be processing. |
The following example shows coded input, and associated table output of the tbl command. The @ (at sign) is used in input to represent an input tab character.
.TS center box ; cB s s cI | cI s ^ | c c l | n n . Household Population _ Town@Households @Number@Size = Bedminster@789@3.26 Bernards Twp.@3087@3.74 Bernardsville@2018@3.30 Bound Brook@3425@3.04 Bridgewater@7897@3.81 Far Hills@240@3.19 .TE
The col command, eqn command, mm command, mmt command, mvt command, neqn command, nroff command, soelim command, troff command.
The mm macro package, mv macro package.