1 .\" $Id: tbl.7,v 1.16 2011/09/03 00:29:21 kristaps Exp $
3 .\" Copyright (c) 2010, 2011 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: September 3 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 centred in
54 .Bd -literal -offset indent
63 When formatted, the following output is produced:
64 .Bd -filled -offset indent -compact
80 Tables are enclosed by the
86 A table consists of an optional single line of table
88 terminated by a semicolon, followed by one or more lines of
90 specifications terminated by a period, then
92 All input must be 7-bit ASCII.
94 .Bd -literal -offset indent
106 that is, data rows are parsed then inserted into the underlying stream
108 This allows data rows to be interspersed by arbitrary
114 .Bd -literal -offset indent
128 .Bd -literal -offset indent
142 The first line of a table consists of space-separated option keys and
143 modifiers terminated by a semicolon.
144 If the first line does not have a terminating semicolon, it is assumed
145 that no options are specified and instead a
148 Some options accept arguments enclosed by parenthesis.
149 The following case-insensitive options are available:
152 This option is not supported by
154 This may also be invoked with
157 Accepts a two-character argument.
158 This option is not supported by
161 This option is not supported by
164 Draw a single-line box around the table.
165 This may also be invoked with
168 Draw a double-line box around the table.
169 This may also be invoked with
172 This option is not supported by
175 Accepts a single-character argument.
176 This character is used as a delimiter between data cells, which otherwise
177 defaults to the tab character.
179 Accepts a natural number (all digits).
180 This option is not supported by
183 This option is not supported by
186 Accepts a single-character argument.
187 This character will be used as the decimal point with the
191 This option is not supported by
195 The table layout follows
200 Layout specifies how data rows are displayed on output.
201 Each layout line corresponds to a line of data; the last layout line
202 applies to all remaining data lines.
203 Layout lines may also be separated by a comma.
204 Each layout cell consists of one of the following case-insensitive keys:
207 Centre a literal string within its column.
209 Right-justify a literal string within its column.
211 Left-justify a literal string within its column.
213 Justify a number around its last decimal point.
214 If the decimal point is not found on the number, it's assumed to trail
217 Horizontally span columns from the last
220 It is an error if spanning columns follow a
225 This option is not supported by
228 Left-justify a literal string and pad with one space.
230 Vertically span rows from the last
233 It is an error to invoke a vertical span on the first layout row.
234 Unlike a horizontal spanner, you must specify an empty cell (if it not
235 empty, the data is discarded) in the corresponding data cell.
237 Replace the data cell (its contents will be lost) with a single
239 This may also be invoked with
242 Replace the data cell (its contents will be lost) with a double
245 Emit a vertical bar instead of data.
247 Emit a double-vertical bar instead of data.
250 Keys may be followed by a set of modifiers.
251 A modifier is either a modifier key or a natural number for specifying
252 the minimum width of a column.
253 The following case-insensitive modifier keys are available:
274 All of these are ignored by
277 For example, the following layout specifies a centre-justified column of
278 minimum width 10, followed by vertical bar, followed by a left-justified
279 column of minimum width 10, another vertical bar, then a column
280 justified about the decimal point in numbers:
284 The data section follows the last layout row.
285 By default, cells in a data section are delimited by a tab.
286 This behaviour may be changed with the
293 is specified, a single or double line, respectively, is drawn across the
299 is specified, a line is drawn within the data field (i.e. terminating
300 within the cell and not draw to the border).
301 If the last cell of a line is
303 all subsequent lines are included as part of the cell until
305 is specified as its own data cell.
306 It may then be followed by a tab
307 .Pq or as designated by Cm tab
308 or an end-of-line to terminate the row.
310 This section documents compatibility between mandoc and other
312 implementations, at this time limited to GNU tbl.
316 In GNU tbl, comments and macros are disallowed prior to the data block
320 implementation allows them.
330 .%T Tbl\(emA Program to Format Tables
334 The tbl utility, a preprocessor for troff, was originally written by M.
335 E. Lesk at Bell Labs in 1975.
336 The GNU reimplementation of tbl, part of the groff package, was released
337 in 1990 by James Clark.
338 A standalone tbl implementation was written by Kristaps Dzonsons in
340 This formed the basis of the implementation that is part of the
346 reference was written by
347 .An Kristaps Dzonsons ,
348 .Mt kristaps@bsd.lv .