GROFF_HDTBL(7) | Miscellaneous Information Manual | GROFF_HDTBL(7) |
NAME
groff_hdtbl - groff `hdtbl' macros for generation of tablesDESCRIPTION
The hdtbl macros consist of four base and three optional macros, controlled by about twenty arguments. The syntax is simple and similar to the HTML table model and nearly as flexible: You can write sequences of tokens (macro calls with their arguments and content data), separated by blanks and beginning with a macro call, into the same line to get compact and cleanly arrranged input. An advantage of hdtbl is that the tables are constructed without calling a preprocessor; this means that groff's full macro capabilities are available. On the other hand, table processing with hdtbl is much slower than using the tbl(1) preprocessor. A further advantage is that the HTML-like syntax of hdtbl will be easily converted to HTML; this is not implemented yet.USAGE
The simplest well-formed table consists of just single calls to the four base table macros in the right order. Here we construct a table with only one cell.
$@
MACROS AND ARGUMENTS
The order of macro calls and other tokens follows the HTML model. In the following list, valid predecessors and successors of all hdtbl macros are given, together with the possible arguments.
$@
$@
$@
- $@
- Begin a new table.
predecessor:
successor:
arguments:
- $@
-
Thickness of the surrounding box border. (no value) means neither a surrounding box border nor any horizontal or vertical separator lines between the table rows and cells. suppresses the surrounding box border, but still allows separator lines between cells and rows.
- $@
-
Border color.
- $@
-
Number of table columns. This argument is necessary if more than one column is in the table and no arguments are present.
- $@
-
Cell padding, i.e., the extra space between the cell space border and the cell contents.
- $@
-
Cell spacing, i.e., the extra space between the table border or vertical or horizontal lines between cells and the cellspace.
- $@
-
Horizontal alignment of the table, if it is smaller than the line width. : left alignment. : centered alignment. : right alignment.
- $@
-
Widths of table cells. , , are either numbers of type or natural numbers with the pseudo-scaling indicator , with the meaning “percent of the actual line length (or column length for inner tables, respectively)”. If there are less width values than table columns, the last width value is used for the remaining cells. The argument
-
for example indicates that the first column is 1.5inches wide; the remaining columns take 1/10 of the column length each.
- $@
- Height of the table. If the table with its contents is lower than , the last row is stretched to this value.
- $@
- Text of caption.
- The (optionally numbered) table caption. is optional.
predecessor:
successor:
arguments:
- $@
-
Vertical alignment of the table caption. : The caption is placed above the table. : The caption is placed below the table.
- $@
- Begin a new table row.
predecessor:
successor:
arguments:
- $@
- The height of the row. If a cell in the row is higher than this value is ignored; otherwise the row height is stretched to .
- $@
-
Begin a table data cell.
- $@
- Begin a table header cell.
- Arguments and cell contents can be mixed. The macro is not really necessary and differs from only in three default settings, similar to the and HTML tags: The contents of is horizontally and vertically centered and typeset in boldface.
predecessor:
successor:
arguments:
- $@
-
The width of this cell is the sum of the widths of the cells above and below this row.
- $@
- The height of this cell is the sum of the heights of the cells left and right of this column.
-
Remark: Overlapping of column and row spanning, as in the following table fragment (the overlapping happens in the second cell in the second row), is invalid and causes incorrect results.
- End of the table.
- This macro finishes a table. It causes one of the following actions.
- •
- If the argument is given, the table is held until it is freed by calling the macro , which in turn prints the table immediately, either at the current position or at the top of the next page if its height is larger than the remaining space on the page.
- •
- Otherwise, if the table is higher than the remaining space on the page, it is printed at the top of the next page.
- •
- If none of the two above constraints hold, the table is printed immediately at the place of its definition.
predecessor:
successor:
arguments:
- $@
- Prevent the table from being printed until it is freed by calling the macro . This argument is ignored for inner (nested) tables.
- $@
- Free the next held table or held tables. Call this utility macro to print tables which are held by using the argument of the macro.
Arguments common to .TBL, .TR, .TD, and .TH
The arguments described in this section can be specified with the and macros, but they are eventually passed on to the table cells. If omitted, the defaults take place, which the user can change by setting the corresponding default registers or strings, as documented below. Setting an argument with the macro has the same effect as setting it for all rows in the table. Setting an argument with a macro has the same effect as setting it for all the or macro in this row.- $@
-
The background color of the table cells. This includes the area specified with the argument. The argument (no value) suppresses a background color; this makes the background transparent.
- $@
-
The foreground color of the cell contents.
- $@
-
The font family for the table. is one of the groff font families, for example for the AvantGarde fonts or for Helvetica-Narrow.
- $@
-
The font style for the table. One of , , , or for roman, bold, italic, or bold italic, respectively. As with roff's request the argument can be used to specify the font family and font style together, for example instead of and .
- $@
-
A decimal or fractional factor , by which the point size for the table is changed, and , by which the vertical line spacing is changed. If is omitted, value is taken for both.
- $@
-
Horizontal alignment of the cell contents in the table. : left alignment. : centered alignment. : both (left and right) alignment. : right alignment.
- $@
-
Vertical alignment of the cell contents in the table for cells lower than the current row. : alignment below the top of the cell. : alignment in the middle of the cell. : alignment above the cell bottom.
- $@
- Horizontal line between the rows. If specified with or this is a separator line to the cell below. (no value): no separator line. : a single separator line between the rows. : a double separator line.
- The thickness of the separator lines is the half of the border thickness, but at least 0.1inches. The distance between the double lines is equal to the line thickness.
-
Remark: Together with for proper formatting the value of must be at least .05inches for single separator lines and .15inches for double separator lines.
- $@
-
Vertical separator line between the cells. If specified with or this is a separator line to the cell on the right. : a single separator line between the cells. : a double separator line. (no value): no vertical cell separator lines. For more information see the documentation of the argument above.
HDTBL CUSTOMIZATION
Before creating the first table, you should configure default values to minimize the markup needed in each table. The following example sets up defaults suitable for typical papers:AUTHOR
Joachim WalsdorffBUGS AND SUGGESTIONS
Please send your commments to the groff mailing list or directly to the author.30 December 2012 | Groff Version 1.22.1 |