blob: f3c5b80bbe57f0ef0c3144e75e6fdd810daec012 [file] [log] [blame]
<!DOCTYPE html>
<html>
<!-- Created by Texinfo 6.8dev+dev, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This manual is for GNU Texinfo (version 6.8dev, 23 February 2022),
a documentation system that can produce both online information and a
printed manual from a single source using semantic markup.
Copyright (C) 1988, 1990-1993, 1995-1999, 2001-2022 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
"GNU Free Documentation License". -->
<title>@table (GNU Texinfo 6.8dev)</title>
<meta name="description" content="@table (GNU Texinfo 6.8dev)">
<meta name="keywords" content="@table (GNU Texinfo 6.8dev)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2any">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="index.html" rel="start" title="Top">
<link href="Command-and-Variable-Index.html" rel="index" title="Command and Variable Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Two_002dcolumn-Tables.html" rel="up" title="Two-column Tables">
<link href="_0040ftable-_0040vtable.html" rel="next" title="@ftable @vtable">
<style type="text/css">
<!--
div.example {margin-left: 3.2em}
-->
</style>
</head>
<body lang="en">
<div class="subsection-level-extent" id="g_t_0040table">
<div class="nav-panel">
<p>
Next: <a href="_0040ftable-_0040vtable.html" accesskey="n" rel="next"><code class="code">@ftable</code> and <code class="code">@vtable</code></a>, Up: <a href="Two_002dcolumn-Tables.html" accesskey="u" rel="up">Making a Two-column Table</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Using-the-_0040table-Command">8.4.1 Using the <code class="code">@table</code> Command</h4>
<a class="anchor" id="table"></a>
<a class="index-entry-id" id="index-Definition-lists_002c-typesetting"></a>
<p>Use the <code class="code">@table</code> 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.
</p>
<p>Write the <code class="code">@table</code> command at the beginning of a line, after a
blank line, and follow it on the same line with an argument that is an
&lsquo;indicating&rsquo; command, such as <code class="code">@code</code>, <code class="code">@samp</code>,
<code class="code">@var</code>, <code class="code">@option</code>, or <code class="code">@kbd</code> (see <a class="pxref" href="Indicating.html">Indicating Definitions, Commands, etc.</a>).
This command will be applied to the text in the first column. For
example, <code class="code">@table @code</code> will cause the text in the first column
to be output as if it had been the argument to a <code class="code">@code</code> command.
</p>
<a class="anchor" id="g_t_0040asis"></a><a class="index-entry-id" id="index-asis"></a>
<p>You may use the <code class="code">@asis</code> command as an argument to
<code class="code">@table</code>. <code class="code">@asis</code> is a command that does nothing: if you
use this command after <code class="code">@table</code>, the first column entries are
output without added highlighting (&ldquo;as is&rdquo;).
</p>
<p>The <code class="code">@table</code> 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 <code class="code">@macro</code>, although an
<code class="code">@alias</code> (for a suitable predefined command) is acceptable.
See <a class="xref" href="Defining-New-Texinfo-Commands.html">Defining New Texinfo Commands</a>.
</p>
<a class="index-entry-id" id="index-item-1"></a>
<p>Begin each table entry with an <code class="code">@item</code> command at the beginning
of a line. Write the text for the first column on the same line as the
<code class="code">@item</code> command. Write the text for the second column on the line
following the <code class="code">@item</code> 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 <code class="code">@item</code>
will be placed in the first column (including any footnotes).
You do not need to type anything for an empty second column.
</p>
<p>Normally, you should put a blank line before an <code class="code">@item</code> 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 <code class="code">@end table</code>, 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.
</p>
<p>For example, the following table highlights the text in the first
column with the <code class="code">@samp</code> command:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">@table @samp
@item foo
This is the text for
@samp{foo}.
@item bar
Text for @samp{bar}.
@end table
</pre></div></div>
<p>This produces:
</p>
<dl class="table">
<dt>&lsquo;<samp class="samp">foo</samp>&rsquo;</dt>
<dd><p>This is the text for
&lsquo;<samp class="samp">foo</samp>&rsquo;.
</p></dd>
<dt>&lsquo;<samp class="samp">bar</samp>&rsquo;</dt>
<dd><p>Text for &lsquo;<samp class="samp">bar</samp>&rsquo;.
</p></dd>
</dl>
<p>If you want to list two or more named items with a single block of
text, use the <code class="code">@itemx</code> command. (See <a class="xref" href="_0040itemx.html"><code class="code">@itemx</code>: Second and Subsequent Items</a>.)
</p>
<p>The <code class="code">@table</code> command (see <a class="pxref" href="#g_t_0040table">Using the <code class="code">@table</code> Command</a>) is not supported
inside <code class="code">@display</code>. Since <code class="code">@display</code> is line-oriented, it
doesn&rsquo;t make sense to use them together. If you want to indent a
table, try <code class="code">@quotation</code> (see <a class="pxref" href="_0040quotation.html"><code class="code">@quotation</code>: Block Quotations</a>) or
<code class="code">@indentedblock</code> (see <a class="pxref" href="_0040indentedblock.html"><code class="code">@indentedblock</code>: Indented text blocks</a>).
</p>
</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="_0040ftable-_0040vtable.html"><code class="code">@ftable</code> and <code class="code">@vtable</code></a>, Up: <a href="Two_002dcolumn-Tables.html">Making a Two-column Table</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>