ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* nested tables?
@ 2008-01-02 15:22 Yvon Henel
  2008-01-02 17:21 ` Wolfgang Schuster
  2008-01-02 18:55 ` Aditya Mahajan
  0 siblings, 2 replies; 5+ messages in thread
From: Yvon Henel @ 2008-01-02 15:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 724 bytes --]

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?

As always, any hint would be greatly appreciated

Many thanks to all
-- 
Yvon Henel

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: nested tables?
  2008-01-02 15:22 nested tables? Yvon Henel
@ 2008-01-02 17:21 ` Wolfgang Schuster
  2008-01-02 18:55 ` Aditya Mahajan
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2008-01-02 17:21 UTC (permalink / raw)
  To: ntg-context; +Cc: mailing list for ConTeXt users

On Wed, 2 Jan 2008 16:22:26 +0100
Yvon Henel <yvon.henel@orange.fr> 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?
> 
> As always, any hint would be greatly appreciated

Do you really need nested tables? Try one of the following solution.

\starttext

\starttable[|c|cp(3cm)|]
\NC \bf ATout Choeur \NC Number 2008--1\crlf january 2008 \NC\AR
\NC \tfa Something \NC \NC\AR
\stoptable

\starttabulate[|c|cp(3cm)|]
\NC \bf ATout Choeur \NC Number 2008--1\crlf january 2008 \NC\NR
\NC \tfa Something \NC \NC\NR
\stoptabulate

\setupTABLE[column][align=middle,frame=off]
\setupTABLE[column][first][style=bold]

\bTABLE
 \bTR
   \bTD ATout Choeur \eTD
   \bTD Number 2008--1\crlf january 2008 \eTD
  \eTR
  \bTR
    \bTD Something \eTD
    \bTD \eTD
  \eTR
\eTABLE

\stoptext

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: nested tables?
  2008-01-02 15:22 nested tables? Yvon Henel
  2008-01-02 17:21 ` Wolfgang Schuster
@ 2008-01-02 18:55 ` Aditya Mahajan
  2008-01-03 14:45   ` Yvon Henel
  1 sibling, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2008-01-02 18:55 UTC (permalink / raw)
  To: Yvon Henel, mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: nested tables?
  2008-01-02 18:55 ` Aditya Mahajan
@ 2008-01-03 14:45   ` Yvon Henel
  2008-01-03 15:02     ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Yvon Henel @ 2008-01-03 14:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 630 bytes --]

Le mercredi 2 janvier 2008, vous avez écrit :
> 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:
[cut]

> 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.

Thank you for this piece of advice. I've found some documents about TABLE
on  the net. I will study them real soon and hope to be able to obtain what I 
want.

-- 
Yvon Henel

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: nested tables?
  2008-01-03 14:45   ` Yvon Henel
@ 2008-01-03 15:02     ` Wolfgang Schuster
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2008-01-03 15:02 UTC (permalink / raw)
  To: ntg-context; +Cc: mailing list for ConTeXt users

On Thu, 3 Jan 2008 15:45:03 +0100
Yvon Henel <yvon.henel@orange.fr> wrote:

> Le mercredi 2 janvier 2008, vous avez écrit :
> > 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:
> [cut]
> 
> > 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.
> 
> Thank you for this piece of advice. I've found some documents about TABLE
> on  the net. I will study them real soon and hope to be able to obtain what I 
> want.

\starttext

\bTABLE[frame=off,align=middle]
 \bTR
   \bTD \bf ATout Choeur \eTD
   \bTD
     {\bTABLE[frame=off,align=middle]
       \bTR\bTD Number 2008--1 \eTD\eTR
       \bTR\bTD january 2008 \eTD\eTR
     \eTABLE}
   \eTD
  \eTR
  \bTR
    \bTD \tfa Something \eTD
    \bTD \eTD
  \eTR
\eTABLE

\stoptext

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-03 15:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-02 15:22 nested tables? Yvon Henel
2008-01-02 17:21 ` Wolfgang Schuster
2008-01-02 18:55 ` Aditya Mahajan
2008-01-03 14:45   ` Yvon Henel
2008-01-03 15:02     ` Wolfgang Schuster

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).