1 .\" $Id: tbl.7,v 1.26 2015/01/29 00:33:57 schwarze Exp $
3 .\" Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2014, 2015 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: January 29 2015 $
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 centered 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 may contain options separated by spaces, tabs,
137 or commas and 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 require arguments enclosed by parentheses.
143 The following case-insensitive options are available:
146 Draw a single-line box around each table cell.
147 Currently treated as a synonym for
150 Draw a single-line box around the table.
151 For GNU compatibility, this may also be invoked with
154 Center the table instead of left-adjusting it.
155 For GNU compatibility, this may also be invoked with
158 Use the single-character argument as the decimal point with the
161 This is a GNU extension.
163 Use the two characters of the argument as
166 Currently unsupported.
168 Draw a double-line box around the table.
169 For GNU compatibility, this may also be invoked with
172 Increase the width of the table to the current line length.
175 Draw lines with the point size given by the unsigned integer argument.
178 Allow page breaks within the table.
179 This is a GNU extension and currently ignored.
181 Ignore leading and trailing spaces in data cells.
182 This is a GNU extension and currently ignored.
184 Suppress warnings about tables exceeding the current line length.
185 This is a GNU extension and currently ignored.
187 Use the single-character argument as a delimiter between data cells.
188 By default, the tab character is used.
191 The table layout follows
196 Layout specifies how data rows are displayed on output.
197 Each layout line corresponds to a line of data; the last layout line
198 applies to all remaining data lines.
199 Layout lines may also be separated by a comma.
200 Each layout cell consists of one of the following case-insensitive keys:
203 Center a literal string within its column.
205 Right-justify a literal string within its column.
207 Left-justify a literal string within its column.
209 Justify a number around its last decimal point.
210 If the decimal point is not found on the number, it's assumed to trail
213 Horizontally span columns from the last
216 It is an error if spanning columns follow a
221 This option is not supported by
224 Left-justify a literal string and pad with one space.
226 Vertically span rows from the last
229 It is an error to invoke a vertical span on the first layout row.
230 Unlike a horizontal spanner, you must specify an empty cell (if it not
231 empty, the data is discarded) in the corresponding data cell.
233 Replace the data cell (its contents will be lost) with a single
235 This may also be invoked with
238 Replace the data cell (its contents will be lost) with a double
241 Emit a vertical bar instead of data.
243 Emit a double-vertical bar instead of data.
246 Keys may be followed by a set of modifiers.
247 A modifier is either a modifier key or a natural number for specifying
248 the minimum width of a column.
249 The following case-insensitive modifier keys are available:
252 Use a bold font for the contents of this column.
254 Move cell content down to the last cell of a vertical span.
257 Make this column wider to match the maximum width
258 of any other column also having the
262 The next character selects the font to use for this column.
265 manual for supported one-character font names.
267 Use an italic font for the contents of this column.
269 Specify a cell start macro.
270 This is a GNU extension and currently unsupported.
272 Set the point size to the following unsigned argument,
273 or change it by the following signed argument.
276 Set the vertical line spacing to the following unsigned argument,
277 or change it by the following signed argument.
280 Do not vertically center cell content in the vertical span,
284 Move cell content up by half a table line.
287 Specify minimum column width.
290 After determining the width of all other columns, distribute the
291 rest of the line length among all columns having the
295 Do not use this cell for determining the width of this column.
298 For example, the following layout specifies a center-justified column of
299 minimum width 10, followed by vertical bar, followed by a left-justified
300 column of minimum width 10, another vertical bar, then a column using
301 bold font justified about the decimal point in numbers:
305 The data section follows the last layout row.
306 By default, cells in a data section are delimited by a tab.
307 This behaviour may be changed with the
314 is specified, a single or double line, respectively, is drawn across the
320 is specified, a line is drawn within the data field (i.e. terminating
321 within the cell and not draw to the border).
322 If the last cell of a line is
324 all subsequent lines are included as part of the cell until
326 is specified as its own data cell.
327 It may then be followed by a tab
328 .Pq or as designated by Cm tab
329 or an end-of-line to terminate the row.
341 equations inside tables.
350 .%T Tbl\(emA Program to Format Tables
354 The tbl utility, a preprocessor for troff, was originally written by M.
355 E. Lesk at Bell Labs in 1975.
356 The GNU reimplementation of tbl, part of the groff package, was released
357 in 1990 by James Clark.
358 A standalone tbl implementation was written by Kristaps Dzonsons in
360 This formed the basis of the implementation that is part of the
366 reference was written by
367 .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .