Changes

Jump to navigation Jump to search
540 bytes added ,  09:03, 23 October 2012
m
no edit summary
</context>
A more realistic example== Rules == === Example: an invoice with thick rules.===
<context source="yes">
\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=18mm20mm, offset=\dimexpr1mm+2pt, align=leftflushright]
\bTR[bottomframe=on, rulethickness=2pt,offset=1mm]
\bTD\bf Date \eTD
</context>
=== Rules with different thickness ===
There is only one value for all four borders. However, MetaPost can be used as a workaround until the separate "rulethickness" values are implemented.
\bTABLE
\dorecurse{7}{\bTR\dorecurse{3}{\bTD#1-##1\eTD}\eTR}
\eTABLE
\bTABLE[setups=tableborders]
\dorecurse{7}{\bTR\dorecurse{3}{\bTD#1-##1\eTD}\eTR}
\eTABLE
See the corresponding thread on the list: [http://www.ntg.nl/pipermail/ntg-context/2011/058549.html rules with different thickness]
=== Thick bottom rules === This is a simplified version of the example above. <context source=yes mode=mkiv text="Gives:">\startuseMPgraphic{MP:thickBtm} draw bottomboundary OverlayBox withpen pensquare scaled \frameddimension{bottomrulethickness}; clip currentpicture to OverlayBox; setbounds currentpicture to OverlayBox;\stopuseMPgraphic \defineoverlay[OL:thickBtm][\useMPgraphic{MP:thickBtm}] \starttext \bTABLE \setupTABLE[align=middle] \setupTABLE[header][background={OL:thickBtm},bottomrulethickness=4pt] \setupTABLE[row][4][background={OL:thickBtm},bottomrulethickness=2pt] % \bTABLEhead\bTR\dorecurse{3}{\bTH#1\eTH}\eTR\eTABLEhead \bTABLEbody\dorecurse{6}{\bTR\dorecurse{3}{\bTD#1-##1\eTD}\eTR}\eTABLEbody \eTABLE\stoptext</context> === Diagonal rules ===
Sometimes a diagonal rule is required in the top left corner cell of a table to create two fields, one for the left column and one for the top row.
105

edits

Navigation menu