Changes

Jump to navigation Jump to search
160 bytes added ,  08:18, 30 July 2015
added some links, enhanced internal formatting
as the text itself.
'''Warning''': When you want to use tables with macros use \{{cmd|starttable }} and \stoptable. \{{cmd|starttabulate }} and \stoptabulate does not work correctly with macros.
=Basic commands=
The control sequence <tt>\{{cmd|starttabulate|[#1]</tt> }} takes a layout
string as optional argument.
As is common with tables in TeX-based typesetting, this string
|}
* <ttcmd>HL</ttcmd> draws a horizontal rule,* <ttcmd>NC</ttcmd> marks a new column (or new cell),* <ttcmd>NN</ttcmd> marks a new math column/cell (see below),* <ttcmd>NR</ttcmd> starts a new row,* <ttcmd>NB</ttcmd> starts a new row as a block (avoids page breaking inside of a block, to keep some lines together<!--; available since beta of 2011-12-21-->);* <ttcmd>TB</ttcmd> (= "Table Blank") adds some vertical space between rows -- see an example bellow.
current page-width. For example: if you want the previous table
take up all the width and having the second column taking three
quarters of the space, change the {{cmd|starttabulate }} to:
<texcode>
\starttabulate[|rw(.25\textwidth)|lw(.75\textwidth)|]
</texcode>
(Mistake: This doesn’t account for the width of the column distance!)
=Horizontal centering table on the page=
<!--(Solution from the mailing list)-->
<context source=yes>
To achieve this the argument <tt>split</tt> must be set to
''true''.
 
''NB'': the difference between setting and unsetting this
argument may not be visible on the first few pages. Rather, it
repeated above at every page break that occurs inside the table.
This name needs to be specified as the argument of the
<tt>title</tt> key of <tt>\{{cmd|setuptabulate</tt>}}.
The <tt>header</tt> key has to be set to <em>text</em> for this
to work.
Tabulate supports header rows that can be repeated over new table
pages instead of the title.
There is a separate environment <tt>\{{cmd|starttablehead</tt> }} where
this header row has to be specified in advance of its use in a
tabulation.
Hans initially announced support for vertical lines and colors on
the mailing list.[http://archive.contextgarden.net/message/20101117.123950.739657a7.en.html]
==Rules==
Context supports different categories of rules that can be
configured individually in order to discern various applications.
Their behaviour accounts for the designated use, e.&nbsp;g.
<tt>\ML</tt> (mid rules) are intended to be deployed between
ordinary rows of the table body and will prevent page breaks
|}
Additionally, there is an options option <tt>rulecolor</tt> for<tt>\{{cmd|setuptabulate</tt> }} that allows for those rules to be tinted.
<texcode>
===Vertical Rules===
The <ttcmd>\VL</ttcmd> command serves as a replacement for <ttcmd>\NC</ttcmd>
to mark a cell border wherever a vertical rule may be desired (if
they are to be desired at all from a typographical point of
For ''horizontal rules'' see above.
For ''vertical rules'', <ttcmd>\VL</ttcmd> takes a defined color as an
optional argument.
There are five color-specific control sequences:
{|
|<ttcmd>CR</ttcmd> || color is applied to the background of the text and the remaining space on the right.
|-
|<ttcmd>CC</ttcmd> || color is applied to the background of the text only.
|-
|<ttcmd>CM</ttcmd> || color is applied to the background of the text and the remaining space on both sides.
|-
|<ttcmd>CL</ttcmd> || color is applied to the background of the text and the remaining space on the left.
|-
|<ttcmd>CT</ttcmd> || color is applied to the text itself - in other words, the "foreground color."
|}
These are to complement the normal table layout expression (the
first argument to <tt>\{{cmd|starttabulate</tt>}.
Thus, in order to colorize a four column table with the initial
layout <tt>|c|c|c|c|</tt> it will have to be modified as follows:
Those control sequences, if applied within the table body, can
replace the ordinary <ttcmd>\NC</ttcmd>, allowing individual cells to
be colorized.
<texcode>
When using an itemization inside a tabulation where one uses also the
<tt>\{{cmd|head</tt> }} command, there occurs a snapping problem. This is related to penalties which force a twoline split whereas the snapping mechanism prevents this. As a result two lines are typeset on top of each other. The solution is to add the following statement to the preamble:
<texcode>\tabulatesplitlinemode \plustwo</texcode>
* More features are constantly added and documented in the {{src|tabl-tbl.mkiv|source}}.
* {{cmd|starttabulate}}, {{cmd|setuptabulate}}
* [[TABLE|Natural Tables]]
* {{cmd|starttable}}, {{cmd|setuptable}}
[[Category:Tables]]

Navigation menu