Open main menu

Changes

156 bytes added ,  20:50, 15 May 2022
<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 =
\stop
</texcode>
 
= Tables in page headers =
 
Sometimes you want to use a table layout in a header, for example to show a company's name and contact information at the top of each page of an invoice. The standard `\bTABLE` command causes issues so use `\bTABLEnested` instead. The parameters are the same.
 
<texcode>
% A setup to define the table's appearance
\startsetups headertable
\setupTABLE[frame=off]
\setupTABLE[column][1][align=flushleft]
\setupTABLE[column][2][align=flushright]
\stopsetups
...
% A setup to define the table's contents
\startsetups headertext
\bTABLEnested[setups=headertable, ...]
...
\eTABLEnested
\stopsetups
...
% Use the table in the header
\setupheadertexts[\setups{headertext}]
 
</texcode>
93

edits