Main index | Section 7 | Options |
Each table is started with a roff(7) amp;TS macro, consist of at most one line of Options, one or more Layout lines, one or more Data lines, and ends with a amp;TE macro. All input must be 7-bit ASCII.
The following options are available. Some of them require arguments enclosed in parentheses:
allbox | |
Draw a single-line box around each table cell. | |
box | Draw a single-line box around the table. For GNU compatibility, this may also be invoked with frame. |
center | |
Center the table instead of left-adjusting it. For GNU compatibility, this may also be invoked with centre. | |
decimalpoint | |
Use the single-character argument as the decimal point with the n layout key. This is a GNU extension. | |
delim | Use the two characters of the argument as eqn(7) delimiters. Currently unsupported. |
doublebox | |
Draw a double-line box around the table. For GNU compatibility, this may also be invoked with doubleframe. | |
expand | |
Increase the width of the table to the current line length. Currently ignored. | |
linesize | |
Draw lines with the point size given by the unsigned integer argument. Currently ignored. | |
nokeep | |
Allow page breaks within the table. This is a GNU extension and currently ignored. | |
nospaces | |
Ignore leading and trailing spaces in data cells. This is a GNU extension. | |
nowarn | |
Suppress warnings about tables exceeding the current line length. This is a GNU extension and currently ignored. | |
tab | Use the single-character argument as a delimiter between data cells. By default, the horizontal tabulator character is used. |
Each layout line consists of one or more layout cell specifications, optionally separated by whitespace. The following case-insensitive key characters start a new cell specification:
c | Center the string in this cell. |
r | Right-justify the string in this cell. |
l | Left-justify the string in this cell. |
n | Justify a number around its last decimal point. If no decimal point is found in the number, it is assumed to trail the number. |
s | Horizontally span columns from the last non- s layout cell. It is an error if a column span follows a _ or = cell, or comes first on a layout line. The combined cell as a whole consumes only one cell of the corresponding data line. |
a | Left-justify a string and pad with one space. |
ha | Vertically span rows from the last non- ha layout cell. It is an error to invoke a vertical span on the first layout line. Unlike a horizontal span, a vertical span consumes a data cell and discards the content. |
_ | Draw a single horizontal line in this cell. This consumes a data cell and discards the content. It may also be invoked with -. |
= | Draw a double horizontal line in this cell. This consumes a data cell and discards the content. |
Each cell key may be followed by zero or more of the following case-insensitive modifiers:
b | Use a bold font for the contents of this cell. |
d | Move content down to the last row of this vertical span. Currently ignored. |
e | Make this column wider to match the maximum width of any other column also having the e modifier. |
f | The next one or two characters select the font to use for this cell. One-character font names must be followed by a blank or period. See the roff(7) manual for supported font names. |
i | Use an italic font for the contents of this cell. |
m | Specify a cell start macro. This is a GNU extension and currently unsupported. |
p | Set the point size to the following unsigned argument, or change it by the following signed argument. Currently ignored. |
v | Set the vertical line spacing to the following unsigned argument, or change it by the following signed argument. Currently ignored. |
t | Do not vertically center content in this vertical span, leave it in the top row. Currently ignored. |
u | Move cell content up by half a table row. Currently ignored. |
w | Specify a minimum column width. |
x | After determining the width of all other columns, distribute the rest of the line length among all columns having the x modifier. |
z | Do not use this cell for determining the width of this column. |
amp;| | Draw a single vertical line to the right of this cell. |
|| | Draw a double vertical line to the right of this cell. |
If a modifier consists of decimal digits, it specifies a minimum spacing in units of n between this column and the next column to the right. The default is 3. If there is a vertical line, it is drawn inside the spacing.
If a data cell contains only the two bytes ‘\ha’, the cell above spans to this row, as if the layout specification of this cell were ha.
If a data cell contains only the single character ‘_’ or ‘=’, a single or double horizontal line is drawn across the cell, joining its neighbours. If a data cell contains only the two character sequence ‘\_’ or ‘\=’, a single or double horizontal line is drawn inside the cell, not joining its neighbours. If a data line contains nothing but the single character ‘_’ or ‘=’, a horizontal line across the whole table is inserted without consuming a layout row.
In place of any data cell, a text block can be used. It starts with amp;T{ at the end of a physical input line. Input line breaks inside the text block neither end the text block nor its data cell. It only ends if amp;T} occurs at the beginning of a physical input line and is followed by an end-of-cell indicator. If the amp;T} is followed by the end of the physical input line, the text block, the data cell, and the data line ends at this point. If the amp;T} is followed by the tab character, only the text block and the data cell end, but the data line continues with the data cell following the tab character. If amp;T} is followed by any other character, it does not end the text block, which instead continues to the following physical input line.
amp;.TS rb c lb r ci l. r center l ri ce le right c left amp;.TE
r center l ri ce le right c left
Some ports in OpenBSD 6.1 to show number alignment and line drawing:
amp;.TS box tab(:); r| l r n. software:version _ AFL:2.39b Mutt:1.8.0 Ruby:1.8.7.374 TeX Live:2015 amp;.TE
software version AFL 2.39b Mutt 1.8.0 Ruby 1.8.7.374 TeX Live 2015
Spans and skipping width calculations:
amp;.TS box tab(:); lz s | rt lt| cb| ha ha | rz s. left:r l:center: :right amp;.TE
left r l center right
Text blocks, specifying spacings and specifying and equalizing column widths, putting lines into individual cells, and overriding allbox:
amp;.TS allbox tab(:); le le||7 lw10. The fourth line:_:line 1 of this column:=:line 2 determines:_:line 3 the column width.:T{ This text is too wide to fit into a column of width 17. T}:line 4 T{ No break here. T}::line 5 amp;.TE
The fourth line _ line 1 of this column = line 2 determines _ line 3 the column width. This text is too wide to fit into a column of width 17. line 4 No break here. line 5
These examples were constructed to demonstrate many tbl features in a compact way. In real manual pages, keep tables as simple as possible. They usually look better, are less fragile, and are more portable.
Tbl — A Program to Format Tables, June 11, 1976.
,TBL (7) | $Mdocdate: September 18 2021 $ |
Main index | Section 7 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.