Changes

Jump to navigation Jump to search
2,502 bytes added ,  21:06, 5 January 2010
</context>
</td></tr></table>
 
In the given sample you can see, that there is a problem with the alignment. This can be improved as follows:
 
<context source="yes" text="produces">
\setupTABLE[row][each][rulethickness=.25pt,offset=\dimexpr1mm+2pt]
\bTABLE
\bTR \bTD 1 \eTD \bTD 1 \eTD \bTD 2/3 \eTD \eTR
\bTR \bTD 2 \eTD \bTD 2 \eTD \bTD 3 \eTD \eTR
\bTR \bTD 2 \eTD \bTD[rulethickness=2pt,offset=1mm] 2 \eTD \bTD 3 \eTD \eTR
\bTR \bTD 1 \eTD \bTD 1 \eTD \bTD 4 \eTD \eTR
\bTR \bTD 1 \eTD \bTD 1 \eTD \bTD 2 \eTD \eTR
\eTABLE
</context>
 
As soon as you want to emphasize a cell with a thicker frame, one has to adjust the offset. Basically the general offset will be enlarged by the amount of the rule thickness. In the cell with the thicker rule the offset is then diminished by the rulethickness.
 
 
I place here a more realistic example. Consider you want to create an invoice with several columns. There are no vertical lines. The top frame of the table should have a thicker rule than the dividing rules between the invoice lines. The bottom frame of the list of invoice lines should have also a thicker rule like the top frame:
 
<context source="yes" text="produces">
{\bfa Invoice}
\switchtobodyfont[6pt]
\blank
\bTABLE
\setupTABLE[frame=off,offset=1mm]
\setupTABLE[row][*][height=7.25mm]
\setupTABLE[column][1]%
[width=18mm,
offset=\dimexpr1mm+2pt,
align=flushleft]
\setupTABLE[column][2]%
[width=20mm,
offset=\dimexpr1mm+2pt,
align=flushleft]
\setupTABLE[column][3]%
[width=18mm,
offset=\dimexpr1mm+2pt,
align=flushright]
\setupTABLE[column][4]%
[width=18mm,
offset=\dimexpr1mm+2pt,
align=flushright]
\setupTABLE[column][5]%
[width=18mm,
offset=\dimexpr1mm+2pt,
align=left]
\bTR[bottomframe=on, rulethickness=2pt,offset=1mm]
\bTD\bf Date \eTD
\bTD\bf Description \eTD
\bTD\bf Quantity \eTD
\bTD\bf Price \eTD
\bTD\bf Total \eTD
\eTR
\bTR[bottomframe=on,rulethickness=.25pt]
\bTD 05-01-2010 \eTD
\bTD Element 1 \eTD
\bTD 10.0 \eTD
\bTD 6.00 \eTD
\bTD 60.00 \eTD
\eTR
\bTR[bottomframe=on,rulethickness=.25pt]
\bTD 05-01-2010 \eTD
\bTD Element 2 \eTD
\bTD 2.0 \eTD
\bTD 3.00 \eTD
\bTD 6.00 \eTD
\eTR
\bTR[topframe=on,rulethickness=2pt,offset=1mm]
\bTD[nx=3] \eTD
\bTD[align=flushleft] Subtotal \eTD
\bTD 66.00 \eTD
\eTR
\bTR[offset=\dimexpr1mm+2pt]
\bTD[nx=3] \eTD
\bTD[align=flushleft] VAT 19\% \eTD
\bTD 12.54 \eTD
\eTR
\bTR
\bTD[nx=3] \eTD
\bTD[align=flushleft] \bf Total \eTD
\bTD 78.54 \eTD
\eTR
\eTABLE
</context>
== Using character alignment ==
48

edits

Navigation menu