1 .\" $Id: tbl.7,v 1.7 2011/01/08 17:30:03 kristaps Exp $
3 .\" Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .Dd $Mdocdate: January 8 2011 $
22 .Nd tbl language reference for mandoc
26 language is a table-formatting language.
33 This manual describes the subset of the
35 language accepted by the
47 macro tags, whose precise syntax is documented in
49 Tables consist of a series of options on a single line, followed by the
50 table layout, followed by data.
52 For example, the following creates a boxed table with digits centered in
54 .Bd -literal -offset indent
63 When formatted, the following output is produced:
64 .Bd -filled -offset indent -compact
73 Tables are enclosed by the
79 A table consists of an optional single line of table
81 terminated by a semicolon, followed by one or more lines of
83 specifications terminated by a period, then
85 All input must be 7-bit ASCII.
87 .Bd -literal -offset indent
99 that is, data rows are parsed then inserted into the underlying stream
101 This allows data rows to be interspersed by arbitrary
107 .Bd -literal -offset indent
121 .Bd -literal -offset indent
135 The first line of a table consists of space-separated option keys and
136 modifiers terminated by a semicolon.
137 If the first line does not have a terminating semicolon, it is assumed
138 that no options are specified and instead a
141 Some options accept arguments enclosed by parenthesis.
142 The following case-insensitive options are available:
145 This option is not supported by
147 This may also be invoked with
150 Accepts a two-character argument.
151 This option is not supported by
154 This option is not supported by
157 Draw a single-line box around the table.
158 This may also be invoked with
161 Draw a double-line box around the table.
162 This may also be invoked with
165 This option is not supported by
168 Accepts a single-character argument.
169 This character is used as a delimiter between data cells, which otherwise
170 defaults to the tab character.
172 Accepts a natural number (all digits).
173 This option is not supported by
176 This option is not supported by
179 Accepts a single-character argument.
180 This character will be used as the decimal point with the
183 This option is not supported by
186 This option is not supported by
190 The table layout follows
195 Layout specifies how data rows are displayed on output.
196 Each layout line corresponds to a line of data; the last layout line
197 applies to all remaining data lines.
198 Layout lines may also be separated by a comma.
199 Each layout cell consists of one of the following case-insensitive keys:
202 Centre a literal string within its column.
204 Right-justify a literal string within its column.
206 Left-justify a literal string within its column.
208 Justify a number around its last decimal point.
209 If the decimal point is not found on the number, it's assumed to trail
212 This option is not supported by
215 Left-justify a literal string and pad with one space.
217 This option is not supported by
220 Replace the data cell (its contents will be lost) with a single
222 This may also be invoked with
225 Replace the data cell (its contents will be lost) with a double
228 Emit a vertical bar instead of data.
230 Emit a double-vertical bar instead of data.
233 Keys may be followed by a set of modifiers.
234 A modifier is either a modifier key or a natural number for specifying
235 the minimum width of a column.
236 The following case-insensitive modifier keys are available:
248 All of these are ignored by
251 For example, the following layout specifies a centre-justified column of
252 minimum width 10, followed by vertical bar, followed by a left-justified
253 column of minimum width 10, another vertical bar, then a column
254 justified about the decimal point in numbers:
258 The data section follows the last layout row.
259 By default, cells in a data section are delimited by a tab.
260 This behaviour may be changed with the
267 is specified, a single or double line, respectively, is drawn across the
273 is specified, a line is drawn within the data field (i.e. terminating
274 within the cell and not draw to the border).
275 If the last cell of a line is
277 all subsequent lines are included as part of the cell until
279 is specified as its own data cell.
280 It may then be followed by a tab
281 .Pq or as designated by Cm tab
282 or an end-of-line to terminate the row.
284 This section documents compatibility between mandoc and other
286 implementations, at this time limited to GNU tbl.
290 In GNU tbl, comments and macros are disallowed prior to the data block
294 implementation allows them.
304 .%T Tbl\(emA Program to Format Tables
308 The tbl utility, a preprocessor for troff, was originally written by M.
309 E. Lesk at Bell Labs in 1975.
310 The GNU reimplementation of tbl, part of the groff package, was released
311 in 1990 by James Clark.
312 A standalone tbl implementation was written by Kristaps Dzonsons in
314 This formed the basis of the implementation that is part of the
320 reference was written by
321 .An Kristaps Dzonsons Aq kristaps@bsd.lv .