htbl.awk

NAME
SYNOPSIS
Description
USAGE
INTERACTION WITH EQN
BUGS
SEE ALSO

NAME

htbl.awk − format tables for troff -Thtml

SYNOPSIS

awk -f htbl.awk [ files... ] | groff ...

Description

htbl.awk(1) translates table markup in the standard tbl(1) format to HTML, prepended with .HTML tags to pass through gtroff(1) and the grohtml(1) postprocessor. The result is a properly-formatted HTML table instead of a table rendered as a graphic.

htbl.awk(1) recognizes a subset of tbl(1) markup, and silently ignores unrecognized options or formatting.

If the command line has no file names, or a file name is − htbl.awk(1) reads the standard input.

USAGE

htbl.awk(1) expects to find table descriptions wrapped in the .TS (table start) and .TE (table end) macros. The line immediately following the .TS macro may contain any of the following global options (currently lower case only):

box

Encloses the table in a box.

allbox

Encloses each item of the table in a box.

expand

Makes the table as wide as the current line length.

tab(x)

Uses the character x instead of a tab to separate items in a line of input data.

The global options must end with a semicolon. There might be whitespace after an option and its argument in parentheses.

After global options come lines describing the format of each line of the table. Each such format line describes one line of the table itself, except that the last format line (which you must end with a period) describes all remaining lines of the table. A single key character describes each column of each line of the table. Currently, htbl.awk does not support the tbl feature of running format specs for multiple lines together on the same line by separating them with commas.

The longest format line defines the number of columns in the table; missing format descriptors at the end of format lines are assumed to be ‘L’. Extra columns in the data (which have no corresponding format entry) are ignored.

The available key characters are:

c,C

Centers item within the column.

r,R

Right-justifies item within the column.

l,L

Left-justifies item within the column.

_,=

Replaces this entry with a horizontal line. The = specifies a double line.

The following specifiers can appear in suffixes to column key letters:

b,B

Make affected entries bold.

i,I

Make affected entries italic.

The format lines are followed by lines containing the actual data for the table, followed finally by .TE. Within such data lines, items are normally separated by tab characters (or the character specified with the tab option).

Comments are dropped.

If a data line consists of only ‘_’, a single line is drawn across the table at that point; if a single item in a data line consists of only ‘_’ then that item is replaced by a single line, joining its neighbours.

INTERACTION WITH EQN

htbl.awk(1) should always be called before eqn(1).

BUGS

Functionality that can be supported in HTML is missing (such as column spanning).

HTML support should be built directly into tbl(1) instead of using a script.

Some browsers may not recognize all table decorations.

SEE ALSO

groff(1), troff(1), tbl(1).