Next: , Up: Making a Two-column Table   [Contents][Index]


8.4.1 Using the @table Command

Use the @table command to produce a two-column table. This command is typically used when you have a list of items and a brief text with each one, such as a list of definitions.

Write the @table command at the beginning of a line, after a blank line, and follow it on the same line with an argument that is an ‘indicating’ command, such as @code, @samp, @var, @option, or @kbd (see Indicating Definitions, Commands, etc.). This command will be applied to the text in the first column. For example, @table @code will cause the text in the first column to be output as if it had been the argument to a @code command.

You may use the @asis command as an argument to @table. @asis is a command that does nothing: if you use this command after @table, the first column entries are output without added highlighting (“as is”).

The @table command works with other commands besides those explicitly mentioned here. However, you can only use predefined Texinfo commands that take an argument in braces. You cannot reliably use a new command defined with @macro, although an @alias (for a suitable predefined command) is acceptable. See Defining New Texinfo Commands.

Begin each table entry with an @item command at the beginning of a line. Write the text for the first column on the same line as the @item command. Write the text for the second column on the line following the @item line and on subsequent lines. You may write as many lines of supporting text as you wish, even several paragraphs. But only the text on the same line as the @item will be placed in the first column (including any footnotes). You do not need to type anything for an empty second column.

Normally, you should put a blank line before an @item line (except the first one). This puts a blank line in the Info file. Except when the entries are very brief, a blank line looks better. End the table with a line consisting of @end table, followed by a blank line. TeX will always start a new paragraph after the table, so the blank line is needed for the Info output to be analogous.

For example, the following table highlights the text in the first column with the @samp command:

@table @samp
@item foo
This is the text for
@samp{foo}.

@item bar
Text for @samp{bar}.
@end table

This produces:

foo

This is the text for ‘foo’.

bar

Text for ‘bar’.

If you want to list two or more named items with a single block of text, use the @itemx command. (See @itemx: Second and Subsequent Items.)

The @table command (see Using the @table Command) is not supported inside @display. Since @display is line-oriented, it doesn’t make sense to use them together. If you want to indent a table, try @quotation (see @quotation: Block Quotations) or @indentedblock (see @indentedblock: Indented text blocks).


Next: @ftable and @vtable, Up: Making a Two-column Table   [Contents][Index]