Difference between revisions of "Command/starttable"

From ConTeXt wiki
(Create reference page)
 
m (cleanup)
Line 37: Line 37:
 
</texcode>
 
</texcode>
  
The first command \placetable has the same function as \placefigure. It takes care
+
The first command \placetable has the same function as [[cmd:placefigure|\placefigure]]. It takes care of spacing before and after the table and numbering. Furthermore the floating mechanism is initialized so the table will be placed at the most optimal location of the page.
of spacing before and after the table and numbering. Furthermore the floating mechanism
 
is initialized so the table will be placed at the most optimal location of the page.
 
  
</ br>
+
 
The table entries are placed between the \starttable � � � \stoptable pair. Between
+
The table entries are placed between the <tt>\starttable</tt> ... <tt>\stoptable</tt> pair. Between the bracket pair your can specify the table format with the column separators <tt>|</tt> and the
the bracket pair your can specify the table format with the column separators | and the
 
 
format keys (see table 11.2).
 
format keys (see table 11.2).
  
<pre>
 
 
<table border="1">
 
<table border="1">
 
<tr><td><b>Key</b></td><td><b>Meaning</b></td></tr>
 
<tr><td><b>Key</b></td><td><b>Meaning</b></td></tr>
Line 56: Line 52:
 
<tr><td>w<></td>  <td>set minimum column width at specified value</td></tr>
 
<tr><td>w<></td>  <td>set minimum column width at specified value</td></tr>
 
</table>
 
</table>
</pre>
 
  
</ br></ br>
 
<pre>
 
 
<table border="1">
 
<table border="1">
<tr><td><b>Command</b></td><td colspan="2"><b>Meaning</b></td></b></tr>
+
<tr><td><b>Command</b></td><td colspan="2"><b>Meaning</b></td></tr>
 
<tr><td>\NR</td> <td>next row</td> <td>make row with no vertical space adjustment</td></tr>
 
<tr><td>\NR</td> <td>next row</td> <td>make row with no vertical space adjustment</td></tr>
 
<tr><td>\FR</td> <td>first row</td> <td>make row, adjust upper spacing</td></tr>
 
<tr><td>\FR</td> <td>first row</td> <td>make row, adjust upper spacing</td></tr>
Line 78: Line 71:
 
<tr><td colspan="3">? \DL, \DC and \DR are used in combination.</td></tr>
 
<tr><td colspan="3">? \DL, \DC and \DR are used in combination.</td></tr>
 
</table>
 
</table>
</pre>
 
 
  
 
== Example ==
 
== Example ==

Revision as of 07:39, 14 April 2010

Template:Reference Cleanup

\starttable

Syntax

\starttable[...] ... \stoptable
[...] text name


Description

\placetable[here][tab:ships]{Ships that moored at Hasselt.}
\starttable[|c|c|]
\HL
\NC \bf Year \NC \bf Number of ships \NC\SR
\HL
\NC 1645 \NC 450 \NC\FR
\NC 1671 \NC 480 \NC\MR
\NC 1676 \NC 500 \NC\MR
\NC 1695 \NC 930 \NC\LR
\HL
\stoptable

...

look at \at{table on}{th page}[tab:ships] % produces "look at table on 3th page"

The first command \placetable has the same function as \placefigure. It takes care of spacing before and after the table and numbering. Furthermore the floating mechanism is initialized so the table will be placed at the most optimal location of the page.


The table entries are placed between the \starttable ... \stoptable pair. Between the bracket pair your can specify the table format with the column separators | and the format keys (see table 11.2).

KeyMeaning
| column separator
c center
l flush left
r flush right
s<n> set intercolumn space at value n = 0; 1; 2
w<> set minimum column width at specified value
CommandMeaning
\NR next row make row with no vertical space adjustment
\FR first row make row, adjust upper spacing
\LR last row make row, adjust lower spacing
\MR mid row make row, adjust upper and lower spacing
\SR separate row make row, adjust upper and lower spacing
\VL vertical line draw a vertical line, go to next column
\NC next column go to next column
\HL horizontal line draw a horizontal
\DL division line? draw a division line over the next column
\DL[n] division line? draw a division line over n columns
\DC division column? draw a space over the next column
\DR division row? make row, adjust upper and lower spacing
\LOW{text} lower text
\TWO, \THREE etc. use the space of the next two, three columns
? \DL, \DC and \DR are used in combination.

Example

See also