# [NTG-context] [NTG] How to split a cell of a table by a diagonal line? by using natural table.

Mojca Miklavec mojca.miklavec.lists at gmail.com
Tue Apr 12 08:45:13 CEST 2011

On Mon, Apr 11, 2011 at 14:00, seasoul wrote:
> a ----------------------------
>              |
>              |
> --------- -b------------------
>
>
> as the illustration, by using natural table, how to split the cell by a
> diagonal line from a to b, and have texts in the resulted splited triangular
> cells?

I once used some cheating:

\startuseMPgraphic{LineBack}
draw (\overlaywidth,0)--(0,\overlayheight);
\stopuseMPgraphic
\defineoverlay[LineBack][\useMPgraphic{LineBack}]

followed by

\setupTABLE[c][1][width=2.6cm]
\setupTABLE[1][1][background=LineBack,align={flushleft,low}]
\bTABLE
\bTR
\bTD \hbox to 2.5cm{{\setbox0=\hbox{first}\wd0=0pt\box0}\hfill
\raise1.1\bodyfontsize\hbox{second}}  \eTD
% ...
\eTR
\eTABLE

This is ugly and doesn't scale well (you need to adjust the
parameters), but it was the only possibility I was able to come up
with quickly.

Mojca


More information about the ntg-context mailing list