2007/3/28, Brian R. Landy <landy@alumni.caltech.edu>:
Hi,

I am having a problem using nested natural tables, to which I have a
solution but feel that it my not be the proper approach.  I'm pretty
much a TeX and ConTeXt novice.

The problem is that the row height it reduced when a table is nested,
breaking vertical text alignment across cells.  In my example the
cells "SSSSS" and "Swap" to not align vertically due to the presence
of the "p".  I have an example of the problem and my fix below.

I'm curious if someone knows a better way to fix this.

Thanks for your help,
Brian

Hi Brian,

I will show a few solution to your problem for the following table.
We will start with a simple table that contains the error.

\starttext

\bTABLE
  \bTR
    \bTD
      {\bTABLE
      \bTR
        \bTD SSSS \eTD
        \bTD Swap \eTD
      \bTR
    \eTABLE}
    \bTD
  \eTR
\eTABLE

\stoptext


Your own solution with adding a strut to the inner table can be done
in a better way by adding the strut to the setup of the beginning of the table.

\starttext

\bTABLE
  \bTR
    \bTD
      {\bTABLE[left=\strut]
        \bTR
          \bTD SSSS \eTD
          \bTD Swap \eTD
        \bTR
      \eTABLE}
    \bTD
  \eTR
\eTABLE

\stoptext
 


Another mothod is to use the same method, that is used for the
outer table. I took a look into the source and found the following method,
that works also.

\starttext

\bTABLE
  \bTR
    \bTD
      {\bTABLE[strut=yes,autostrut=no]
         \bTR
           \bTD SSSS \eTD
           \bTD Swap \eTD
         \bTR
       \eTABLE}
    \bTD
  \eTR
\eTABLE

\stoptext


After that a was interested why we need to set the values in the
last example again, because they are already set in core-ntb.
The solution is, the values in nested tables are removed and replaced
by new ones. This behaviour can be changed and is shown in my last
example.

\starttext

\setfalse\resetTABLEmode

\bTABLE
  \bTR
    \bTD
      {\bTABLE
         \bTR
           \bTD SSSS \eTD
           \bTD Swap \eTD
         \bTR
       \eTABLE}
    \bTD
  \eTR
\eTABLE

\stoptext


Another example that shows the effect of \resetTABLEmode is:

\starttext

%\settrue\resetTABLEmode % default setting

\setupTABLE[frame=off]

\bTABLE
  \bTR
    \bTD
      {\bTABLE\bTR\bTD Text \eTD\eTR\eTABLE}
    \eTD
    \bTD
      Text
    \eTD
  \eTR
\eTABLE

\setfalse\resetTABLEmode

\bTABLE
  \bTR
    \bTD
      {\bTABLE\bTR\bTD Text \eTD\eTR\eTABLE}
    \eTD
    \bTD
      Text
    \eTD
  \eTR
\eTABLE

\stoptext


Wolfgang