1 .\" $Id: tbl.7,v 1.20 2014/10/14 02:16:06 schwarze Exp $
3 .\" Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 .Dd $Mdocdate: October 14 2014 $
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
74 Tables are enclosed by the
80 A table consists of an optional single line of table
82 terminated by a semicolon, followed by one or more lines of
84 specifications terminated by a period, then
86 All input must be 7-bit ASCII.
88 .Bd -literal -offset indent
100 that is, data rows are parsed then inserted into the underlying stream
102 This allows data rows to be interspersed by arbitrary
108 .Bd -literal -offset indent
122 .Bd -literal -offset indent
136 The first line of a table consists of space-separated option keys and
137 modifiers terminated by a semicolon.
138 If the first line does not have a terminating semicolon, it is assumed
139 that no options are specified and instead a
142 Some options accept arguments enclosed by parenthesis.
143 The following case-insensitive options are available:
146 This option is not supported by
148 This may also be invoked with
151 Accepts a two-character argument.
152 This option is not supported by
155 This option is not supported by
158 Draw a single-line box around the table.
159 This may also be invoked with
162 Draw a double-line box around the table.
163 This may also be invoked with
166 This option is not supported by
169 Accepts a single-character argument.
170 This character is used as a delimiter between data cells, which otherwise
171 defaults to the tab character.
173 Accepts a natural number (all digits).
174 This option is not supported by
177 This option is not supported by
180 Accepts a single-character argument.
181 This character will be used as the decimal point with the
185 This option is not supported by
189 The table layout follows
194 Layout specifies how data rows are displayed on output.
195 Each layout line corresponds to a line of data; the last layout line
196 applies to all remaining data lines.
197 Layout lines may also be separated by a comma.
198 Each layout cell consists of one of the following case-insensitive keys:
201 Centre a literal string within its column.
203 Right-justify a literal string within its column.
205 Left-justify a literal string within its column.
207 Justify a number around its last decimal point.
208 If the decimal point is not found on the number, it's assumed to trail
211 Horizontally span columns from the last
214 It is an error if spanning columns follow a
219 This option is not supported by
222 Left-justify a literal string and pad with one space.
224 Vertically span rows from the last
227 It is an error to invoke a vertical span on the first layout row.
228 Unlike a horizontal spanner, you must specify an empty cell (if it not
229 empty, the data is discarded) in the corresponding data cell.
231 Replace the data cell (its contents will be lost) with a single
233 This may also be invoked with
236 Replace the data cell (its contents will be lost) with a double
239 Emit a vertical bar instead of data.
241 Emit a double-vertical bar instead of data.
244 Keys may be followed by a set of modifiers.
245 A modifier is either a modifier key or a natural number for specifying
246 the minimum width of a column.
247 The following case-insensitive modifier keys are available:
250 Use a bold font for the contents of this column.
252 Make this column wider to match the maximum width
253 of any other column also having the
257 The next character selects the font to use for this column.
260 manual for supported one-character font names.
262 Use an italic font for the contents of this column.
264 After determining the width of all other columns, distribute the
265 rest of the line length among all columns having the
269 Do not use this cell for determining the width of this column.
281 For example, the following layout specifies a centre-justified column of
282 minimum width 10, followed by vertical bar, followed by a left-justified
283 column of minimum width 10, another vertical bar, then a column using
284 bold font justified about the decimal point in numbers:
288 The data section follows the last layout row.
289 By default, cells in a data section are delimited by a tab.
290 This behaviour may be changed with the
297 is specified, a single or double line, respectively, is drawn across the
303 is specified, a line is drawn within the data field (i.e. terminating
304 within the cell and not draw to the border).
305 If the last cell of a line is
307 all subsequent lines are included as part of the cell until
309 is specified as its own data cell.
310 It may then be followed by a tab
311 .Pq or as designated by Cm tab
312 or an end-of-line to terminate the row.
314 This section documents compatibility between mandoc and other
316 implementations, at this time limited to GNU tbl.
320 In GNU tbl, comments and macros are disallowed prior to the data block
324 implementation allows them.
334 .%T Tbl\(emA Program to Format Tables
338 The tbl utility, a preprocessor for troff, was originally written by M.
339 E. Lesk at Bell Labs in 1975.
340 The GNU reimplementation of tbl, part of the groff package, was released
341 in 1990 by James Clark.
342 A standalone tbl implementation was written by Kristaps Dzonsons in
344 This formed the basis of the implementation that is part of the
350 reference was written by
351 .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .