https://wiki.contextgarden.net/api.php?action=feedcontributions&user=84.58.97.41&feedformat=atomWiki - User contributions [en]2024-03-28T20:28:39ZUser contributionsMediaWiki 1.34.1https://wiki.contextgarden.net/index.php?title=Table&diff=2297Table2005-01-30T23:04:27Z<p>84.58.97.41: </p>
<hr />
<div>< [[Tables Overview]]<br />
<br />
This is ConTeXts oldest table module. It uses the same formatting as [[tabulate]]. (See [[Tables Overview]] for an overview.)<br />
<br />
<texcode><br />
\placetable[here][tab:sample]{sample table}<br />
\starttable[|l|l|]<br />
\HL<br />
\NC Command \NC Meaning \NC\SR<br />
\HL<br />
\NC \tex{NC} \NC next column \NC\FR<br />
\NC \tex{HL} \NC horizontal line \NC\MR<br />
\NC \tex{VL} \NC vertical line \NC\MR<br />
\NC \tex{NR} \NC next row \NC\LR<br />
\HL<br />
\NC \tex{SR} \NC single row \NC\FR<br />
\NC \tex{FR} \NC first row \NC\MR<br />
\NC \tex{MR} \NC middle row \NC\MR<br />
\NC \tex{LR} \NC last row \NC\LR<br />
\HL<br />
\NC \tex{AR} \NC automatic row \NC\SR<br />
\HL<br />
\stoptable<br />
</texcode><br />
<br />
The different "row end" commands make a better spacing. Better use <cmd>SR</cmd>, <cmd>FR</cmd>, <cmd>MR</cmd>, <cmd>LR</cmd> instead of <cmd>NR</cmd>. You can also use <cmd>AR</cmd> instead of <cmd>SR</cmd>, <cmd>FR</cmd>, <cmd>MR</cmd> and <cmd>LR</cmd> (AR for automatic row).<br />
<br />
If you need information about <cmd>placetable</cmd> look after <cmd>placefloat</cmd> in the manual!<br />
If you'd like to leave out the table's caption, you can't simply leave the braces empty but must write <tt>none</tt>!<br />
<br />
This mode is based on Michael Wichura's TaBlE package for PlainTeX. The official manual for it is commercial (about 40 USD), see [http://www.pctex.com PCTeX] -- but note that the TaBlE manual only talks about the original syntax, which does not use <cmd>NC</cmd>, <cmd>HL</cmd> cum suis.<br />
<br />
The only ConTeXt docs about it are in [http://www.pragma-ade.com/general/manuals/ms-cb-en.pdf ms-cb-en.pdf].<br />
<br />
<br />
The sample looks like this:<br />
<br />
<context><br />
\placetable[here][tab:sample]{sample table}<br />
\starttable[|l|l|]<br />
\HL<br />
\NC Command \NC Meaning \NC\SR<br />
\HL<br />
\NC \tex{NC} \NC next column \NC\FR<br />
\NC \tex{HL} \NC horizontal line \NC\MR<br />
\NC \tex{VL} \NC vertical line \NC\MR<br />
\NC \tex{NR} \NC next row \NC\LR<br />
\HL<br />
\NC \tex{SR} \NC single row \NC\FR<br />
\NC \tex{FR} \NC first row \NC\MR<br />
\NC \tex{MR} \NC middle row \NC\MR<br />
\NC \tex{LR} \NC last row \NC\LR<br />
\HL<br />
\NC \tex{AR} \NC automatic row \NC\SR<br />
\HL<br />
\stoptable<br />
</context><br />
<br />
A very nice application in table are background colors for rows/cells (a feature that doesn't work in tabulate):<br />
<texcode><br />
\setupcolors[state=start]<br />
\placetable[here][tab:sample]{sample table}<br />
\starttable[|l|l|]<br />
\HL<br />
\BL[2]\SR<br />
\NC Command \NC Meaning \NC\SR<br />
\HL<br />
\NC \tex{NC} \NC next column \NC\FR<br />
\NC \tex{HL} \NC horizontal line \NC\MR<br />
\NC \tex{VL} \NC vertical line \NC\MR<br />
\NC \tex{NR} \NC next row \NC\LR<br />
\HL<br />
\CL[green]\SR<br />
\NC \tex{AR} \NC automatic row \NC\SR<br />
\HL<br />
\stoptable<br />
</texcode><br />
The commands work something like this: first, you say what background colour you want for the next row<br />
and then you typeset the row. Observe: the line with the colour-command and the row it is supposed<br />
to colour should end in the same command (i.e. both \SR, \LR, \FR, ...). If they don't, the background<br />
won't cover the whole cell.<br />
<br />
* \BL makes a gray background: the optional argument tells BL how many cells it should color<br />
* \CL makes a colored line<br />
<context><br />
\setupcolors[state=start]<br />
\placetable[here][tab:sample]{sample table}<br />
\starttable[|l|l|]<br />
\HL<br />
\BL[1]\SR<br />
\NC Command \NC Meaning \NC\SR<br />
\HL<br />
\NC \tex{NC} \NC next column \NC\FR<br />
\NC \tex{HL} \NC horizontal line \NC\MR<br />
\NC \tex{VL} \NC vertical line \NC\MR<br />
\NC \tex{NR} \NC next row \NC\LR<br />
\HL<br />
\CL[green]\SR<br />
\NC \tex{AR} \NC automatic row \NC\SR<br />
\HL<br />
\stoptable<br />
</context></div>84.58.97.41