Node: table, Next: , Up: Two-column Tables



Using the @table Command

Use the @table command to produce two-column tables. It is usually listed for "definition lists" of various sorts, where you have a list of terms and a brief text with each one.

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 a Texinfo "indicating" command such as @code, @samp, @var, @option, or @kbd (see Indicating).

This command will be applied to the text that goes into the first column of each item and thus determines how it will be highlighted. For example, @table @code will cause the text in the first column to be output as if it @code command.

You may also 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 commands that normally take arguments in braces. (In this case, however, you use the command name without an argument, because the subsequent @item's will supply the argument.)

Begin each table entry with an @item command at the beginning of a line. Write the first column text on the same line as the @item command. Write the second column text on the line following the @item line and on subsequent lines. (You do not need to type anything for an empty second column entry.) 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).

Normally, you should put a blank line before an @item line. 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.

The following table, for example, highlights the text in the first column with an @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.)