Changes

Jump to navigation Jump to search
2,259 bytes added ,  13:34, 4 November 2006
Round corners
\bTR\bTD f1 \eTD\bTD[m=4] f4 \eTD\bTD[m=5] f5 \eTD\bTD[m=7] f7 \eTD\eTR
\eTABLE
</context>
 
== Round corners ==
 
It is possible to round the corners of the table if you turn off the main frame of the table and frame the table in [[cmd:framed|\framed]]. Compare two different approaches in the first and second example.
 
You can't color the background of the table with round corners unless the frame rulethickness is not big enough to cover the rectangular corners of the background (second example). Well, you can if you frame the table twice. Once in the thick white frame and then in the thin frame with negative offset and slightly smaller corner radius (third example). Be aware of other complications -- notice that the thick white frame is still visible in the text above it.
 
<context source="yes">
\starttext
\setupcolors[state=start]
%\showstruts
\setupTABLE[background=color,backgroundcolor=yellow]
\setupframed[framecolor=darkgreen]
 
First
 
\def\StartTable
{\setupTABLE[row] [first][topframe=off]%
\setupTABLE[row] [last] [bottomframe=off]%
\setupTABLE[column][first][leftframe=off]%
\setupTABLE[column][last] [rightframe=off]%
\framed[strut=no,corner=round,offset=.5\linewidth]
\bgroup}
 
\def\StopTable
{\egroup}
 
\StartTable
\bTABLE
\bTR \bTD test \eTD \bTD test \eTD \eTR
\bTR \bTD test \eTD \bTD test \eTD \eTR
\bTR \bTD test \eTD \bTD test \eTD \eTR
\eTABLE
\StopTable
 
Second
 
\setupTABLE[row] [first][topframe=off]
\setupTABLE[row] [last] [bottomframe=off]
\setupTABLE[column][first][leftframe=off]
\setupTABLE[column][last] [rightframe=off]
\framed[strut=no,corner=round,offset=.5\linewidth,,rulethickness=1mm]\bgroup
\bTABLE
\bTR \bTD test \eTD \bTD test \eTD \eTR
\bTR \bTD test \eTD \bTD test \eTD \eTR
\bTR \bTD test \eTD \bTD test \eTD \eTR
\eTABLE
\egroup
 
Third
 
\setupTABLE[row] [first][topframe=off]
\setupTABLE[row] [last] [bottomframe=off]
\setupTABLE[column][first][leftframe=off]
\setupTABLE[column][last] [rightframe=off]
\framed[strut=no,corner=round,radius=1.4mm,offset=-1mm,,rulethickness=.1mm]\bgroup
\framed[strut=no,corner=round,radius=1.5mm,offset=0mm,,rulethickness=1mm,framecolor=white]\bgroup
\bTABLE
\bTR \bTD test \eTD \bTD test \eTD \eTR
\bTR \bTD test \eTD \bTD test \eTD \eTR
\bTR \bTD test \eTD \bTD test \eTD \eTR
\eTABLE
\egroup
\egroup
 
\stoptext
</context>
[[Category:Tables]]
[[Category:XML]]
138

edits

Navigation menu