Tbl
Encyclopedia
Part of the troff
Troff
troff is a document processing system developed by AT&T for the Unix operating system.-History:troff can trace its origins back to a text formatting program called RUNOFF, written by Jerome H. Saltzer for MIT's CTSS operating system in the mid-1960s...

 suite of Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 document layout tools, tbl is a preprocessor that formats tables
Table (information)
A table is a means of arranging data in rows and columns.Production % of goalNorth 4087102%South 4093110% The use of tables is pervasive throughout all communication, research and data analysis. Tables appear in print media, handwritten notes, computer software, architectural...

.

Like the main troff program, tbl uses command lines interspersed with data to be printed. Because of the nature of tabular data
Data
The term data refers to qualitative or quantitative attributes of a variable or set of variables. Data are typically the results of measurements and can be the basis of graphs, images, or observations of a set of variables. Data are often viewed as the lowest level of abstraction from which...

 having rows and columns, tbl commands also intraline delimiters for fields and to indicate where to draw lines.

First a line starting with .TS, followed by full table options such as center to center the table on a line or box to draw a box around it (boxes in tbl are drawn with overlapping hyphens and underscores; there were no line drawing commands at the time of creation. Disjoint edges can be observed upon close inspection).
Succeeding lines set up the formatting of each cell in the table with one character flags, such as c to center data in its cell, hyphen
Hyphen
The hyphen is a punctuation mark used to join words and to separate syllables of a single word. The use of hyphens is called hyphenation. The hyphen should not be confused with dashes , which are longer and have different uses, or with the minus sign which is also longer...

s to draw horizontal rules, vertical bar
Vertical bar
The vertical bar is a character with various uses in mathematics, where it can be used to represent absolute value, among others; in computing and programming and in general typography, as a divider not unlike the interpunct...

s to draw vertical rules, and caret
Caret
Caret usually refers to the spacing symbol ^ in ASCII and other character sets. In Unicode, however, the corresponding character is , whereas the Unicode character named caret is actually a similar but lowered symbol: ....

s to span cells vertically.

The last formatting ends a period
Full stop
A full stop is the punctuation mark commonly placed at the end of sentences. In American English, the term used for this punctuation is period. In the 21st century, it is often also called a dot by young people...

 indicate cell data follows. The data comes next, one line per row, with tab
Tab
Tab or tabs may refer to:* Tab, a British Army term for a loaded march* Tab , by Monster Magnet* Tab , a small protective covering for the fingers* Tab , the mechanism for opening a beverage can...

s (by default) separating cells. Finally a line containing just .TE ends the table.

This is just a summary of tbl syntax, which can vary in small details from implementation to implementation. GNU troff (groff
Groff (software)
Groff is the GNU replacement for the troff and nroff text formatters. It is an original implementation written primarily in C++ by James Clark and is modeled after ditroff, including many extensions. The first version, 0.3.1, was released June 1990. The first stable version, 1.04, was announced in...

), Heirloom troff, and mandoc
Mandoc
mandoc is an ISC licensed utility for formatting man pages, specifically those written in the mdoc macro language...

contain tbl implementations.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK