ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: Yvon Henel <yvon.henel@orange.fr>,
	 mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: nested tables?
Date: Wed, 2 Jan 2008 13:55:16 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.0.9999.0801021341060.9436@nqv-yncgbc> (raw)
In-Reply-To: <200801021622.30681.yvon.henel@orange.fr>

On Wed, 2 Jan 2008, Yvon Henel wrote:

> Hello again,
>
> I would like to nest a table inside a table, something like this:
>
> \starttable[|c|c|]
> \NC {\bf ATout Choeur} \NC
> {\starttable[|c|]
>   \NC Number 2008--1\FR
>   \NC january 2008\LR
> \stoptable}\MR
> \NC {\tfa Something} \NC \LR
> \stoptable
>
> but 1/ I would like the top of the first cell of the first row to be aligned
> with the top of the second one (which contains the nested table);
>      2/ it seems that it does not work when the layout is set up
> with "grid=yes"
>
> If the answer to the second question is "Effectively, it can't work in such a
> layout", what could be a way of obtaining what I want?

tables (starttables...stoptables) cannot be nested. Table does some 
automatic checking of number of columns, and that counting is global. So, 
nested tables messes the count. Here is an example:

\starttext
\starttable[|c|c|]
\NC \the\currentTABLEcolumn/ \the\maxTABLEcolumn\NC
{\starttable[|c|]
\NC \the\currentTABLEcolumn/ \the\maxTABLEcolumn\NC \AR
\NC test \NC \AR
\stoptable}
  \NC \AR
\NC \the\currentTABLEcolumn/ \the\maxTABLEcolumn\NC \NC \AR
\stoptable
\stoptext


> As always, any hint would be greatly appreciated

You can always use multicolumns, and give the impression that you are 
using multiple tables. For example

\starttable[|c|c|c|]
  \NC col 1 \NC nested 1 \NC nested 2 \NC \AR
  \NC       \NC nested 1 \NC nested 2 \NC \AR
  \NC col 1 \NC \TWO{ col 2 }         \NC \AR
\stoptable

This, of course, will not work if you want nested tables with different 
number of columns in different rows. In that case, TABLE macros (bTABLE .. 
eTABLE) would be the way to go.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  parent reply	other threads:[~2008-01-02 18:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-02 15:22 Yvon Henel
2008-01-02 17:21 ` Wolfgang Schuster
2008-01-02 18:55 ` Aditya Mahajan [this message]
2008-01-03 14:45   ` Yvon Henel
2008-01-03 15:02     ` Wolfgang Schuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.0.9999.0801021341060.9436@nqv-yncgbc \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    --cc=yvon.henel@orange.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).