2 .\" Permission to use, copy, modify, and distribute this software for any
3 .\" purpose with or without fee is hereby granted, provided that the above
4 .\" copyright notice and this permission notice appear in all copies.
6 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
8 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
10 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
11 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
12 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 .\" Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
16 .\" Copyright 2012 Nexenta Systems, Inc. All rights reserved.
23 .Nd tbl language reference for mandoc
27 language is a table-formatting language.
34 This manual describes the subset of the
36 language accepted by the
48 macro tags, whose precise syntax is documented in
50 Tables consist of a series of options on a single line, followed by the
51 table layout, followed by data.
53 For example, the following creates a boxed table with digits centred in
55 .Bd -literal -offset indent
64 When formatted, the following output is produced:
65 .Bd -filled -offset indent -compact
81 Tables are enclosed by the
87 A table consists of an optional single line of table
89 terminated by a semicolon, followed by one or more lines of
91 specifications terminated by a period, then
93 All input must be 7-bit ASCII.
95 .Bd -literal -offset indent
107 that is, data rows are parsed then inserted into the underlying stream
109 This allows data rows to be interspersed by arbitrary
115 .Bd -literal -offset indent
129 .Bd -literal -offset indent
143 The first line of a table consists of space-separated option keys and
144 modifiers terminated by a semicolon.
145 If the first line does not have a terminating semicolon, it is assumed
146 that no options are specified and instead a
149 Some options accept arguments enclosed by parenthesis.
150 The following case-insensitive options are available:
153 This option is not supported by
155 This may also be invoked with
158 Accepts a two-character argument.
159 This option is not supported by
162 This option is not supported by
165 Draw a single-line box around the table.
166 This may also be invoked with
169 Draw a double-line box around the table.
170 This may also be invoked with
173 This option is not supported by
176 Accepts a single-character argument.
177 This character is used as a delimiter between data cells, which otherwise
178 defaults to the tab character.
180 Accepts a natural number (all digits).
181 This option is not supported by
184 This option is not supported by
187 Accepts a single-character argument.
188 This character will be used as the decimal point with the
192 This option is not supported by
196 The table layout follows
201 Layout specifies how data rows are displayed on output.
202 Each layout line corresponds to a line of data; the last layout line
203 applies to all remaining data lines.
204 Layout lines may also be separated by a comma.
205 Each layout cell consists of one of the following case-insensitive keys:
208 Centre a literal string within its column.
210 Right-justify a literal string within its column.
212 Left-justify a literal string within its column.
214 Justify a number around its last decimal point.
215 If the decimal point is not found on the number, it's assumed to trail
218 Horizontally span columns from the last
221 It is an error if spanning columns follow a
226 This option is not supported by
229 Left-justify a literal string and pad with one space.
231 Vertically span rows from the last
234 It is an error to invoke a vertical span on the first layout row.
235 Unlike a horizontal spanner, you must specify an empty cell (if it not
236 empty, the data is discarded) in the corresponding data cell.
238 Replace the data cell (its contents will be lost) with a single
240 This may also be invoked with
243 Replace the data cell (its contents will be lost) with a double
246 Emit a vertical bar instead of data.
248 Emit a double-vertical bar instead of data.
251 Keys may be followed by a set of modifiers.
252 A modifier is either a modifier key or a natural number for specifying
253 the minimum width of a column.
254 The following case-insensitive modifier keys are available:
275 All of these are ignored by
278 For example, the following layout specifies a centre-justified column of
279 minimum width 10, followed by vertical bar, followed by a left-justified
280 column of minimum width 10, another vertical bar, then a column
281 justified about the decimal point in numbers:
285 The data section follows the last layout row.
286 By default, cells in a data section are delimited by a tab.
287 This behaviour may be changed with the
294 is specified, a single or double line, respectively, is drawn across the
300 is specified, a line is drawn within the data field (i.e. terminating
301 within the cell and not draw to the border).
302 If the last cell of a line is
304 all subsequent lines are included as part of the cell until
306 is specified as its own data cell.
307 It may then be followed by a tab
308 .Pq or as designated by Cm tab
309 or an end-of-line to terminate the row.
311 This section documents compatibility between mandoc and other
313 implementations, at this time limited to GNU tbl.
317 In GNU tbl, comments and macros are disallowed prior to the data block
321 implementation allows them.
331 .%T Tbl\(emA Program to Format Tables
335 The tbl utility, a preprocessor for troff, was originally written by M.
336 E. Lesk at Bell Labs in 1975.
337 The GNU reimplementation of tbl, part of the groff package, was released
338 in 1990 by James Clark.
339 A standalone tbl implementation was written by Kristaps Dzonsons in
341 This formed the basis of the implementation that is part of the
347 reference was written by
348 .An Kristaps Dzonsons ,
349 .Mt kristaps@bsd.lv .