LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

tbl

Format tables for groff and troff

TLDR

Process a file containing tables through tbl and groff
$ groff -t [file.roff] | [less]
copy
Process tables with equation support
$ tbl [file.roff] | eqn | troff
copy
Process from stdin
$ cat [file.roff] | tbl
copy
Process a man page containing tables
$ tbl [page.man] | nroff -man | less
copy
Enable AT&T compatibility mode
$ tbl -C [file.roff]
copy

SYNOPSIS

tbl [-Cv] [file...]

DESCRIPTION

tbl is a preprocessor for the groff/troff document formatting system that formats tables. It translates table descriptions embedded between .TS (table start) and .TE (table end) macros into troff formatting commands.Tables are defined with a format section specifying column alignment and a data section containing the content. Column classifiers include L (left), R (right), C (center), N (numeric alignment), and A (alphabetic). Modifiers like b (bold) and i (italic) can be applied to columns.Region options control table appearance: box draws a border, center horizontally centers the table, expand stretches it to fill the line width, and tab(c) sets the column separator character.tbl is typically invoked via groff -t rather than directly. When using multiple preprocessors, tbl should run before eqn (equations). The groff command handles ordering automatically.

PARAMETERS

-C

Enable AT&T compatibility mode; recognize .TS and .TE even when followed by a character other than space or newline.
-v, --version
Print version information and exit
--help
Display usage information and exit

TABLE SYNTAX

$ .TS
box center;
c c c
l l n.
Header1 Header2 Value
Data1 Data2 100
Data3 Data4 200
.TE
copy
c/l/r/n = center/left/right/numeric alignment
Lines ending with . separate format from data
Tab character separates columns by default

INSTALL

sudo apt install groff-base
copy
sudo dnf install groff-base
copy
sudo pacman -S groff
copy
sudo apk add groff
copy
sudo zypper install groff
copy
brew install groff
copy
nix profile install nixpkgs#groff
copy

CAVEATS

GNU tbl output requires GNU troff; it cannot be processed by AT&T troff. Complex tables with many spans or nested elements can be difficult to debug. The tab character is the default separator; use tab(;) to change it.

HISTORY

tbl was written by M.E. Lesk at Bell Labs and first documented in 1976 in the paper "TBL -- A Program to Format Tables." The GNU version was written by James Clark as part of groff. It extends the original with features like unlimited columns and improved compatibility.

SEE ALSO

groff(1), troff(1), nroff(1), eqn(1), pic(1), refer(1), col(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid