Changes

Jump to navigation Jump to search
3,123 bytes added ,  20:50, 15 May 2022
Note that every element must use <tt>\b</tt> ... <tt>\e</tt>.
Willi Egger wrote a [[This Way - My Way#MyWay|My Way]] how he set a typesetter's lead type case: [http://dl.contextgarden.net/myway/NaturalTables.pdf Use of natural tables]
= Multipage TABLEs =
Note that the table is split after the yyy row.
 
== Headers with TABLEs ==
 
When one has a multi-page TABLE in the document (using either the <tt>split=repeat</tt> or <tt>split=yes</tt> options), and the header text is also organized as a TABLE, the table header ends up getting crammed into the document header resulting in incorrect output. To alleviate this {{cmd|bTABLEnested}} and {{cmd|eTABLEnested}} may be used as in the example below to ensure that table headers don't get mixed up with the document header.
 
<texcode>
\setupheadertexts[\directsetup{headertable}]
 
\startsetups [headertable]
\bTABLEnested[option=stretch,frame=off]
\setupTABLE[c][1][align=flushleft]
\setupTABLE[c][2][align=flushright]
\bTR
\bTD
Firstname Lastname \par
123, First street \par
Ph: 1234567890 \par
\eTD
\bTD
Company Name \par
123, First street \par
Ph: 9876543210 \par
\eTD
\eTR
\eTABLEnested
\stopsetups
 
\starttext
 
\bTABLE[split=repeat, option=stretch]
\bTABLEhead
\bTR[style=bold]\dorecurse{5}{\bTH Header Col #1\eTH}\eTR
\eTABLEhead
\bTABLEbody
\dorecurse{50}{\bTR\dorecurse{5}{\bTD Row #1 col ##1\eTD}\eTR}
\eTABLEbody
\eTABLE
 
\stoptext
</texcode>
 
Compiling the above by using {{cmd|bTABLE}} and {{cmd|eTABLE}} instead of {{cmd|bTABLEnested}} and {{cmd|eTABLEnested}} in the setup for <tt>headertable</tt> one notices the need for the nested type.
= Tables in multiple columns =
= Creating tables from CSV data (Comma Separated Values) =
See also [[mM-database|the database module]]!
and [http://dl.contextgarden.net/myway/csv.pdf Creating Tables using CSV (Comma-separated values)] by Mojca Miklavec
From the mailing list at 2005-11-09 by Vit Zyka, modified by Hans Hagen:
<texcodecontext source="yes">\starttextsetuppapersize[A5]
% distance mechanism, per column (H)
\eTABLE
}
 \stoptext</texcodecontext>
== Row Offset/Gap ==
\eTABLE
</context>
 
== Cells with breaking lines ==
 
If you provide a width to a cell the lines will break.
 
<context source="yes" text="produces">
\setupTABLE[c][2][width=3cm]
\bTABLE
\bTR \bTD 1 \eTD \bTD This is a very long line that should break. \eTD \eTR
\eTABLE
</context>
 
== Rules ==
<texcode>
Text\footnote{Normal Footnote}
\bTABLE[split=repeat,align=normal]
\bTR\bTD Something\postponenotes\footnote[x]{bla bla}\eTD\eTR \bTR\bTD Foo \note[x] \eTD\eTR\eTABLE\flushnotesMore Text\footnote{Another Normal Footnote}</texcode><context mode=mkiv source=no>\setupnote[footnote][location=text]\setupnotations[alternative=serried]\starttextText\footnote{Normal Footnote}\bTABLE[split=repeat,align=normal]\bTR\bTD Something\postponenotes\footnote[x]{bla bla}\eTD\eTR\bTR\bTD Foo\note[x] \eTD\eTR\eTABLE\flushnotesMore Text\footnote{Another Normal Footnote}Note that the context wiki is eating the footnote numbers, but that they are there anyways.\placefootnotes\stoptext  </context> = Settings for multiple TABLEs in a single page = Please note that if you have multiple TABLEs in a single page, use the \start & \stop commands to ensure the locality of the attributes of each table. Else settings from one TABLE might have strange effects on the settings of another. When you need a certain setup for multiple tables you can put all \setupTABLE commands in a setups-environment and load these settings at the start of the table, e.g. <texcode>\startsetups [tablesettings] \setupTABLE [r] [1] [..,..=..,..] \setupTABLE [c] [2] [..,..=..,..]\stopsetups \bTABLE[setups=tablesettings] ...\eTABLE</texcode> When you need individual settings for each table add \start before the setup-commands and \stop after the table, this keeps all setups local to the current table, e.g. <texcode>\start \setupTABLE [r] [1] [..,..=..,..]\setupTABLE [c] [2] [..,..=..,..] \bTABLE ...\flushnoteseTABLE \stop
</texcode>
93

edits

Navigation menu