ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* table background color in first row
@ 2010-11-11 18:44 Manfred Lotz
  2010-11-11 19:13 ` Wolfgang Schuster
  2010-11-11 21:54 ` Aditya Mahajan
  0 siblings, 2 replies; 20+ messages in thread
From: Manfred Lotz @ 2010-11-11 18:44 UTC (permalink / raw)
  To: ntg-context

Hi there,


I have s simple table like this:

\starttext

\starttable[|l|l|]
\NC \bf Colheader 1 \NC \bf Colheader 2 \NC \SR \HL 
\NC cell 11 \NC cell 12 \NC \FR
\NC cell 11 \NC cell 12 \NC \LR
\stoptable

\stoptext      


and like to have a light gray background for the heading row. 

I found documentation about \setupTABLE which on the one hand I did not
fully understand how to use and on the other hand I'm not quite sure
how far this is the way it is done nowadays.



-- 
Thanks,
Manfred


___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-11 18:44 table background color in first row Manfred Lotz
@ 2010-11-11 19:13 ` Wolfgang Schuster
  2010-11-11 19:40   ` Manfred Lotz
  2010-11-11 19:42   ` Herbert Voss
  2010-11-11 21:54 ` Aditya Mahajan
  1 sibling, 2 replies; 20+ messages in thread
From: Wolfgang Schuster @ 2010-11-11 19:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 11.11.2010 um 19:44 schrieb Manfred Lotz:

> Hi there,
> 
> I have s simple table like this:
> 
> \starttext
> 
> \starttable[|l|l|]
> \NC \bf Colheader 1 \NC \bf Colheader 2 \NC \SR \HL 
> \NC cell 11 \NC cell 12 \NC \FR
> \NC cell 11 \NC cell 12 \NC \LR
> \stoptable
> 
> \stoptext      
> 
> and like to have a light gray background for the heading row. 
> 
> I found documentation about \setupTABLE which on the one hand I did not
> fully understand how to use and on the other hand I'm not quite sure
> how far this is the way it is done nowadays.

The \setupTABLE command for the natural tables environment, you can find
a overview of the different environments on the wiki.

Here is a example for a natural table:

\starttext

\setupTABLE[header][style=bold,background=color,backgroundcolor=gray]

\bTABLE
  \bTABLEhead
    \bTR
      \bTD Colheader 1 \eTD
      \bTD Colheader 2 \eTD
    \eTR
  \eTBALEhead
  \bTABLEbody
    \bTR
      \bTD cell 11 \eTD
      \bTD cell 12 \eTD
    \eTR
    \bTR
      \bTD cell 21 \eTD
      \bTD cell 22 \eTD
    \eTR
  \eTABLEbody
\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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-11 19:13 ` Wolfgang Schuster
@ 2010-11-11 19:40   ` Manfred Lotz
  2010-11-11 19:56     ` Herbert Voss
  2010-11-11 19:58     ` Wolfgang Schuster
  2010-11-11 19:42   ` Herbert Voss
  1 sibling, 2 replies; 20+ messages in thread
From: Manfred Lotz @ 2010-11-11 19:40 UTC (permalink / raw)
  To: ntg-context

Hi Wolfgang,

On Thu, 11 Nov 2010 20:13:22 +0100
Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:

> 
> Am 11.11.2010 um 19:44 schrieb Manfred Lotz:
> 
> > Hi there,
> > 
> > I have s simple table like this:
> > 
> > \starttext
> > 
> > \starttable[|l|l|]
> > \NC \bf Colheader 1 \NC \bf Colheader 2 \NC \SR \HL 
> > \NC cell 11 \NC cell 12 \NC \FR
> > \NC cell 11 \NC cell 12 \NC \LR
> > \stoptable
> > 
> > \stoptext      
> > 
> > and like to have a light gray background for the heading row. 
> > 
> > I found documentation about \setupTABLE which on the one hand I did
> > not fully understand how to use and on the other hand I'm not quite
> > sure how far this is the way it is done nowadays.
> 
> The \setupTABLE command for the natural tables environment, you can
> find a overview of the different environments on the wiki.
> 
> Here is a example for a natural table:
> 
> \starttext
> 
> \setupTABLE[header][style=bold,background=color,backgroundcolor=gray]
> 
> \bTABLE
>   \bTABLEhead
>     \bTR
>       \bTD Colheader 1 \eTD
>       \bTD Colheader 2 \eTD
>     \eTR
>   \eTBALEhead
>   \bTABLEbody
>     \bTR
>       \bTD cell 11 \eTD
>       \bTD cell 12 \eTD
>     \eTR
>     \bTR
>       \bTD cell 21 \eTD
>       \bTD cell 22 \eTD
>     \eTR
>   \eTABLEbody
> \eTABLE
> 
> \stoptext
> 

Thanks for your example which works fine but raises some more questions:

1. Your example creates borders around each cell which I don't want to
have. Any way to get rid of them?


2. It seems to me that \setupTABLE creates a shading for the header for 
all tables in a document?! That is ok. 

However, I'd like to know what would be the variant to have it only for
a single table?


3. How does this \bTABLE stuff compare to the \starttable stuff? Are
these just different methods to create tables which are both in use
these days in context or is one method to be preferred over the other? 



-- 
Thanks,
Manfred



___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-11 19:13 ` Wolfgang Schuster
  2010-11-11 19:40   ` Manfred Lotz
@ 2010-11-11 19:42   ` Herbert Voss
  2010-11-11 19:45     ` Manfred Lotz
  2010-11-11 19:45     ` Hans Hagen
  1 sibling, 2 replies; 20+ messages in thread
From: Herbert Voss @ 2010-11-11 19:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 11.11.2010 20:13, schrieb Wolfgang Schuster:

> The \setupTABLE command for the natural tables environment, you can find
> a overview of the different environments on the wiki.
> 
> Here is a example for a natural table:
> 
> \starttext
> 
> \setupTABLE[header][style=bold,background=color,backgroundcolor=gray]
> 
> \bTABLE
>   \bTABLEhead
>     \bTR
>       \bTD Colheader 1 \eTD
>       \bTD Colheader 2 \eTD
>     \eTR
>   \eTBALEhead

with current minimal mkiv I get:

(/opt/context/tex/texmf-context/tex/context/base/bxml-apa.mkiv)
systems         : begin file latex5.tex at line 3
)
Runaway argument?
\bTR \bTD Colheader 1 \eTD \bTD Colheader 2 \eTD \eTR \eTBALEhead
\bTABLEbody \ETC.
! File ended while scanning use of \doTABLEhead.

system          > error on line 0 in file : File ended while scanning
use of \doTABLEhead ...

<empty file>

<inserted text>
                \par
<*> ./latex5.tex

?


Herbert
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-11 19:42   ` Herbert Voss
@ 2010-11-11 19:45     ` Manfred Lotz
  2010-11-11 19:45     ` Hans Hagen
  1 sibling, 0 replies; 20+ messages in thread
From: Manfred Lotz @ 2010-11-11 19:45 UTC (permalink / raw)
  To: ntg-context

Hi Herbert,

On Thu, 11 Nov 2010 20:42:17 +0100
Herbert Voss <Herbert.Voss@FU-Berlin.DE> wrote:

> >   \eTBALEhead  


there was a typo which I corrected:  TBALE --> TABLE

-- 
Manfred


___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-11 19:42   ` Herbert Voss
  2010-11-11 19:45     ` Manfred Lotz
@ 2010-11-11 19:45     ` Hans Hagen
  2010-11-11 19:53       ` Herbert Voss
  1 sibling, 1 reply; 20+ messages in thread
From: Hans Hagen @ 2010-11-11 19:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11-11-2010 8:42, Herbert Voss wrote:
> Am 11.11.2010 20:13, schrieb Wolfgang Schuster:
>
>> The \setupTABLE command for the natural tables environment, you can find
>> a overview of the different environments on the wiki.
>>
>> Here is a example for a natural table:
>>
>> \starttext
>>
>> \setupTABLE[header][style=bold,background=color,backgroundcolor=gray]
>>
>> \bTABLE
>>    \bTABLEhead
>>      \bTR
>>        \bTD Colheader 1 \eTD
>>        \bTD Colheader 2 \eTD
>>      \eTR
>>    \eTBALEhead
>
> with current minimal mkiv I get:
>
> (/opt/context/tex/texmf-context/tex/context/base/bxml-apa.mkiv)
> systems         : begin file latex5.tex at line 3
> )
> Runaway argument?
> \bTR \bTD Colheader 1 \eTD \bTD Colheader 2 \eTD \eTR \eTBALEhead

typo: \eTBALEhead -> \eTABLEhead

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-11 19:45     ` Hans Hagen
@ 2010-11-11 19:53       ` Herbert Voss
  0 siblings, 0 replies; 20+ messages in thread
From: Herbert Voss @ 2010-11-11 19:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 11.11.2010 20:45, schrieb Hans Hagen:
> On 11-11-2010 8:42, Herbert Voss wrote:
>> Am 11.11.2010 20:13, schrieb Wolfgang Schuster:
>>
>>> The \setupTABLE command for the natural tables environment, you can find
>>> a overview of the different environments on the wiki.
>>>
>>> Here is a example for a natural table:
>>>
>>> \starttext
>>>
>>> \setupTABLE[header][style=bold,background=color,backgroundcolor=gray]
>>>
>>> \bTABLE
>>>    \bTABLEhead
>>>      \bTR
>>>        \bTD Colheader 1 \eTD
>>>        \bTD Colheader 2 \eTD
>>>      \eTR
>>>    \eTBALEhead

>> Runaway argument?
>> \bTR \bTD Colheader 1 \eTD \bTD Colheader 2 \eTD \eTR \eTBALEhead
> 
> typo: \eTBALEhead -> \eTABLEhead

uuh, should have seen it myself ...

Herbert
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-11 19:40   ` Manfred Lotz
@ 2010-11-11 19:56     ` Herbert Voss
  2010-11-11 20:01       ` Manfred Lotz
  2010-11-11 19:58     ` Wolfgang Schuster
  1 sibling, 1 reply; 20+ messages in thread
From: Herbert Voss @ 2010-11-11 19:56 UTC (permalink / raw)
  To: ntg-context

Am 11.11.2010 20:40, schrieb Manfred Lotz:

>> \starttext
>>
>> \setupTABLE[header][style=bold,background=color,backgroundcolor=gray]
>>
>> \bTABLE
>>   \bTABLEhead
>>     \bTR
>>       \bTD Colheader 1 \eTD
>>       \bTD Colheader 2 \eTD
>>     \eTR
>>   \eTBALEhead
>>   \bTABLEbody
>>     \bTR
>>       \bTD cell 11 \eTD
>>       \bTD cell 12 \eTD
>>     \eTR
>>     \bTR
>>       \bTD cell 21 \eTD
>>       \bTD cell 22 \eTD
>>     \eTR
>>   \eTABLEbody
>> \eTABLE
>>
>> \stoptext
>>
> 
> Thanks for your example which works fine but raises some more questions:
> 
> 1. Your example creates borders around each cell which I don't want to
> have. Any way to get rid of them?

\bTABLE[frame=off]

Herbert
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-11 19:40   ` Manfred Lotz
  2010-11-11 19:56     ` Herbert Voss
@ 2010-11-11 19:58     ` Wolfgang Schuster
  2010-11-11 20:24       ` Manfred Lotz
  1 sibling, 1 reply; 20+ messages in thread
From: Wolfgang Schuster @ 2010-11-11 19:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 11.11.2010 um 20:40 schrieb Manfred Lotz:

> Thanks for your example which works fine but raises some more questions:
> 
> 1. Your example creates borders around each cell which I don't want to
> have. Any way to get rid of them?

You can disable the border rules with „frame=off“.

> 2. It seems to me that \setupTABLE creates a shading for the header for 
> all tables in a document?! That is ok. 
> 
> However, I'd like to know what would be the variant to have it only for
> a single table?

\startsetups table:mystyle

  \setupTABLE            [frame=off]
  \setupTABLE[row][first][style=bold,background=color,backgroundcolor=gray]

\stopsetups

\bTABLE[setups=table:mystyle]
  \bTR
    \bTD Colheader 1 \eTD
    \bTD Colheader 2 \eTD
  \eTR
  \bTR
    \bTD cell 11 \eTD
    \bTD cell 11 \eTD
  \eTR
  \bTR
    \bTD cell 11 \eTD
    \bTD cell 11 \eTD
  \eTR
\eTABLE

or

\bTABLE[frame=off]
  \bTR[background=color,backgroundcolor=gray]
    \bTH Colheader 1 \eTH
    \bTH Colheader 2 \eTH
  \eTR
  \bTR
    \bTD cell 11 \eTD
    \bTD cell 11 \eTD
  \eTR
  \bTR
    \bTD cell 11 \eTD
    \bTD cell 11 \eTD
  \eTR
\eTABLE

> 3. How does this \bTABLE stuff compare to the \starttable stuff? Are
> these just different methods to create tables which are both in use
> these days in context or is one method to be preferred over the other? 

Both are different method to write a table, \starttable/\stoptable is
older than \bTABLE/\eTABLE which use \framed for each table cell and
allows more fancy layouts but is slower than \starttable.

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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-11 19:56     ` Herbert Voss
@ 2010-11-11 20:01       ` Manfred Lotz
  2010-11-11 20:19         ` Manfred Lotz
  2010-11-11 20:21         ` Wolfgang Schuster
  0 siblings, 2 replies; 20+ messages in thread
From: Manfred Lotz @ 2010-11-11 20:01 UTC (permalink / raw)
  To: ntg-context

On Thu, 11 Nov 2010 20:56:48 +0100
Herbert Voss <Herbert.Voss@FU-Berlin.DE> wrote:

> [frame=off]

We come closer. However, I like to have the horizontal line below the
header row. 



-- 
Manfred


___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-11 20:01       ` Manfred Lotz
@ 2010-11-11 20:19         ` Manfred Lotz
  2010-11-11 20:21         ` Wolfgang Schuster
  1 sibling, 0 replies; 20+ messages in thread
From: Manfred Lotz @ 2010-11-11 20:19 UTC (permalink / raw)
  To: ntg-context

On Thu, 11 Nov 2010 21:01:52 +0100
Manfred Lotz <manfred.lotz@arcor.de> wrote:

> On Thu, 11 Nov 2010 20:56:48 +0100
> Herbert Voss <Herbert.Voss@FU-Berlin.DE> wrote:
> 
> > [frame=off]
> 
> We come closer. However, I like to have the horizontal line below the
> header row. 
> 
> 
> 

OK, I found it:

\setupTABLE[row][first][bottomframe=on]    



-- 
Manfred


___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-11 20:01       ` Manfred Lotz
  2010-11-11 20:19         ` Manfred Lotz
@ 2010-11-11 20:21         ` Wolfgang Schuster
  1 sibling, 0 replies; 20+ messages in thread
From: Wolfgang Schuster @ 2010-11-11 20:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 11.11.2010 um 21:01 schrieb Manfred Lotz:

> We come closer. However, I like to have the horizontal line below the
> header row. 

\bTABLE[frame=off]
  \bTR[bottomframe=on,...]
    \bTH Celheader 1 \eTH
    ...

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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-11 19:58     ` Wolfgang Schuster
@ 2010-11-11 20:24       ` Manfred Lotz
  0 siblings, 0 replies; 20+ messages in thread
From: Manfred Lotz @ 2010-11-11 20:24 UTC (permalink / raw)
  To: ntg-context

On Thu, 11 Nov 2010 20:58:24 +0100
Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:

> 
> Am 11.11.2010 um 20:40 schrieb Manfred Lotz:
> 
> > Thanks for your example which works fine but raises some more
> > questions:
> > 
> > 1. Your example creates borders around each cell which I don't want
> > to have. Any way to get rid of them?
> 
> You can disable the border rules with „frame=off“.
> 

Yep. Just found that I get back the first horizontal line by:

\setupTABLE[row][first][bottomframe=on]    


> > 2. It seems to me that \setupTABLE creates a shading for the header
> > for all tables in a document?! That is ok. 
> > 
> > However, I'd like to know what would be the variant to have it only
> > for a single table?
> 
> \startsetups table:mystyle
> 
>   \setupTABLE            [frame=off]
>   \setupTABLE[row][first][style=bold,background=color,backgroundcolor=gray]
> 
> \stopsetups
> 
> \bTABLE[setups=table:mystyle]
>   \bTR
>     \bTD Colheader 1 \eTD
>     \bTD Colheader 2 \eTD
>   \eTR
>   \bTR
>     \bTD cell 11 \eTD
>     \bTD cell 11 \eTD
>   \eTR
>   \bTR
>     \bTD cell 11 \eTD
>     \bTD cell 11 \eTD
>   \eTR
> \eTABLE
> 
> or
> 
> \bTABLE[frame=off]
>   \bTR[background=color,backgroundcolor=gray]
>     \bTH Colheader 1 \eTH
>     \bTH Colheader 2 \eTH
>   \eTR
>   \bTR
>     \bTD cell 11 \eTD
>     \bTD cell 11 \eTD
>   \eTR
>   \bTR
>     \bTD cell 11 \eTD
>     \bTD cell 11 \eTD
>   \eTR
> \eTABLE
> 

Great, good to know.



> > 3. How does this \bTABLE stuff compare to the \starttable stuff? Are
> > these just different methods to create tables which are both in use
> > these days in context or is one method to be preferred over the
> > other? 
> 
> Both are different method to write a table, \starttable/\stoptable is
> older than \bTABLE/\eTABLE which use \framed for each table cell and
> allows more fancy layouts but is slower than \starttable.
> 

Aaah, ok. Does it mean that \starttable/\stoptable is a simpler way of
writing tables with less possiblities than the \bTABLE/\eTABLE stuff? 

Is also seemed to me that it is not easy to get those shadings using
\starttable/\stoptable. Otherwise you would have given me an example
using \starttable/\stoptable.



-- 
Thanks,
Manfred





___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: table background color in first row
  2010-11-11 18:44 table background color in first row Manfred Lotz
  2010-11-11 19:13 ` Wolfgang Schuster
@ 2010-11-11 21:54 ` Aditya Mahajan
  2010-11-12 18:19   ` Hans Hagen
  1 sibling, 1 reply; 20+ messages in thread
From: Aditya Mahajan @ 2010-11-11 21:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

This is mainly for completeness:

On Thu, 11 Nov 2010, Manfred Lotz wrote:

> and like to have a light gray background for the heading row.

> \starttext
>
> \starttable[|l|l|]
\BL[2] \SR
% or
% \CL[gray] \SR
> \NC \bf Colheader 1 \NC \bf Colheader 2 \NC \SR \HL
> \NC cell 11 \NC cell 12 \NC \FR
> \NC cell 11 \NC cell 12 \NC \LR
> \stoptable
>
> \stoptext

Both \BL and \CL work with MkII but in MkIV \BL gives a black rule (rather 
than gray), which \CL gives an error. Hans, any ideas?

For a simple table, you can also use

\startTABLE
  \NC .... \NC  ... \NC \NR
  \NC .... \NC  ... \NC \NR
\stopTABLE

which is wrapper around \bTABLE .. \eTABLE.

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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-11 21:54 ` Aditya Mahajan
@ 2010-11-12 18:19   ` Hans Hagen
  2010-11-12 18:24     ` Hans Hagen
                       ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Hans Hagen @ 2010-11-12 18:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11-11-2010 10:54, Aditya Mahajan wrote:
> This is mainly for completeness:
>
> On Thu, 11 Nov 2010, Manfred Lotz wrote:
>
>> and like to have a light gray background for the heading row.
>
>> \starttext
>>
>> \starttable[|l|l|]
> \BL[2] \SR
> % or
> % \CL[gray] \SR
>> \NC \bf Colheader 1 \NC \bf Colheader 2 \NC \SR \HL
>> \NC cell 11 \NC cell 12 \NC \FR
>> \NC cell 11 \NC cell 12 \NC \LR
>> \stoptable
>>
>> \stoptext
>
> Both \BL and \CL work with MkII but in MkIV \BL gives a black rule
> (rather than gray), which \CL gives an error. Hans, any ideas?
>
> For a simple table, you can also use
>
> \startTABLE
> \NC .... \NC ... \NC \NR
> \NC .... \NC ... \NC \NR
> \stopTABLE
>
> which is wrapper around \bTABLE .. \eTABLE.

The color handling in the old table module is implemented by overloading 
TaBlE code and quite a hack. In mkiv it's easy to add color support but 
then I'd rather remove some of the old commands. In tabulate one can do 
(experimental so not enabled by default):

\ctxlua{nodes.tasks.enableaction("shipouts","nodes.handlers.backgrounds")}

\starttabulate[||p||]
\NC test \NC test \NC test \NC \NR
\NC test \NC[green] \input tufte  \NC[yellow] test \NC \NR
\NC test \NC test \NC test \NC \NR
\NC test \NC test \NC test \NC \NR
\NC test \NC test \NC test \NC \NR
\NC test \NC test \NC test \NC \NR
\NC[blue] test \NC[red] test \NC test \NC \NR
\NC test \NC test \NC test \NC \NR
\NC test \NC test \NC test \NC \NR
\NC test \NC test \NC test \NC \NR
\NC test \NC test \NC[gray] test \NC \NR
\NC test \NC test \NC test \NC \NR
\NC test \NC test \NC test \NC \NR
\NC[blue] test \NC test \NC test \NC \NR
\NC test \NC test \NC test \NC \NR
\NC test \NC test \NC[magenta] test \NC \NR
\NC test \NC test \NC test \NC \NR
\NC test \NC[cyan] \dorecurse{10}{\input ward }\NC test \NC \NR
\NC test \NC test \NC test \NC \NR
\NC test \NC[yellow] test \NC test \NC \NR
\stoptabulate

So, if there's interest in the \starttable .. \stoptable mechanism (i 
have no idea how often it is used) I can consider weeding and redoing 
some of that code (or just rewrite it from scratch which is probably 
easier).

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-12 18:19   ` Hans Hagen
@ 2010-11-12 18:24     ` Hans Hagen
  2010-11-12 19:13     ` Wolfgang Schuster
  2010-11-12 21:38     ` Aditya Mahajan
  2 siblings, 0 replies; 20+ messages in thread
From: Hans Hagen @ 2010-11-12 18:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 12-11-2010 7:19, Hans Hagen wrote:

> \ctxlua{nodes.tasks.enableaction("shipouts","nodes.handlers.backgrounds")}

i'll upload a beta where this is not needed

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-12 18:19   ` Hans Hagen
  2010-11-12 18:24     ` Hans Hagen
@ 2010-11-12 19:13     ` Wolfgang Schuster
  2010-11-12 21:41       ` Aditya Mahajan
  2010-11-12 21:38     ` Aditya Mahajan
  2 siblings, 1 reply; 20+ messages in thread
From: Wolfgang Schuster @ 2010-11-12 19:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 12.11.2010 um 19:19 schrieb Hans Hagen:

> So, if there's interest in the \starttable .. \stoptable mechanism (i have no idea how often it is used) I can consider weeding and redoing some of that code (or just rewrite it from scratch which is probably easier).

There is still a use for the old table macros because it’s easier to set small tables (alignment in the preamble versus many \setupTABLE settings), you can set different spacing between rows which is not part of tabulate and you can span cells (also not supported in tabulate).

To make the environment more attractive you should use the tabulate mechanism for background colors (\BC[...] and \VL[...]) and a indent option would be usefull to indent the table in a narrower environment and in itemize.

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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-12 18:19   ` Hans Hagen
  2010-11-12 18:24     ` Hans Hagen
  2010-11-12 19:13     ` Wolfgang Schuster
@ 2010-11-12 21:38     ` Aditya Mahajan
  2 siblings, 0 replies; 20+ messages in thread
From: Aditya Mahajan @ 2010-11-12 21:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, 12 Nov 2010, Hans Hagen wrote:

> On 11-11-2010 10:54, Aditya Mahajan wrote:
>> This is mainly for completeness:
>> 
>> On Thu, 11 Nov 2010, Manfred Lotz wrote:
>> 
>>> and like to have a light gray background for the heading row.
>> 
>>> \starttext
>>> 
>>> \starttable[|l|l|]
>> \BL[2] \SR
>> % or
>> % \CL[gray] \SR
>>> \NC \bf Colheader 1 \NC \bf Colheader 2 \NC \SR \HL
>>> \NC cell 11 \NC cell 12 \NC \FR
>>> \NC cell 11 \NC cell 12 \NC \LR
>>> \stoptable
>>> 
>>> \stoptext
>> 
>> Both \BL and \CL work with MkII but in MkIV \BL gives a black rule
>> (rather than gray), which \CL gives an error. Hans, any ideas?
>> 
>> For a simple table, you can also use
>> 
>> \startTABLE
>> \NC .... \NC ... \NC \NR
>> \NC .... \NC ... \NC \NR
>> \stopTABLE
>> 
>> which is wrapper around \bTABLE .. \eTABLE.
>
> The color handling in the old table module is implemented by overloading 
> TaBlE code and quite a hack. In mkiv it's easy to add color support but then 
> I'd rather remove some of the old commands. In tabulate one can do 
> (experimental so not enabled by default):
>
> \ctxlua{nodes.tasks.enableaction("shipouts","nodes.handlers.backgrounds")}
>
> \starttabulate[||p||]
> \NC test \NC test \NC test \NC \NR
> \NC test \NC[green] \input tufte  \NC[yellow] test \NC \NR
> \NC test \NC test \NC test \NC \NR
> \NC test \NC test \NC test \NC \NR
> \NC test \NC test \NC test \NC \NR
> \NC test \NC test \NC test \NC \NR
> \NC[blue] test \NC[red] test \NC test \NC \NR
> \NC test \NC test \NC test \NC \NR
> \NC test \NC test \NC test \NC \NR
> \NC test \NC test \NC test \NC \NR
> \NC test \NC test \NC[gray] test \NC \NR
> \NC test \NC test \NC test \NC \NR
> \NC test \NC test \NC test \NC \NR
> \NC[blue] test \NC test \NC test \NC \NR
> \NC test \NC test \NC test \NC \NR
> \NC test \NC test \NC[magenta] test \NC \NR
> \NC test \NC test \NC test \NC \NR
> \NC test \NC[cyan] \dorecurse{10}{\input ward }\NC test \NC \NR
> \NC test \NC test \NC test \NC \NR
> \NC test \NC[yellow] test \NC test \NC \NR
> \stoptabulate

Can you also add vertical lines and row background colors?

> So, if there's interest in the \starttable .. \stoptable mechanism (i have no 
> idea how often it is used) I can consider weeding and redoing some of that 
> code (or just rewrite it from scratch which is probably easier).

Personally, I do not like the \starttable ... \stoptable macros (the 
patchup with TaBlE macro is too convoluted)  and am happy with the compact 
\startTABLE syntax. But then, I don't use tables too often anyways.

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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: table background color in first row
  2010-11-12 19:13     ` Wolfgang Schuster
@ 2010-11-12 21:41       ` Aditya Mahajan
  2010-11-13  5:47         ` Wolfgang Schuster
  0 siblings, 1 reply; 20+ messages in thread
From: Aditya Mahajan @ 2010-11-12 21:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 848 bytes --]

On Fri, 12 Nov 2010, Wolfgang Schuster wrote:

>
> Am 12.11.2010 um 19:19 schrieb Hans Hagen:
>
>> So, if there's interest in the \starttable .. \stoptable mechanism (i have no idea how often it is used) I can consider weeding and redoing some of that code (or just rewrite it from scratch which is probably easier).
>
> There is still a use for the old table macros because it’s easier to set 
> small tables (alignment in the preamble versus many \setupTABLE 
> settings), you can set different spacing between rows which is not part 
> of tabulate and you can span cells (also not supported in tabulate).

Perhaps we can add an align key to \startTABLE macro so that we could say

\startTABLE[align={left, right, middle}]
  \NC a \NC b \NC c \NC \NR
  \NC a \NC b \NC c \NC \NR
\stopTABLE

similar to math alignment.

Aditya

[-- Attachment #2: Type: text/plain, Size: 486 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: table background color in first row
  2010-11-12 21:41       ` Aditya Mahajan
@ 2010-11-13  5:47         ` Wolfgang Schuster
  0 siblings, 0 replies; 20+ messages in thread
From: Wolfgang Schuster @ 2010-11-13  5:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 12.11.2010 um 22:41 schrieb Aditya Mahajan:

> Perhaps we can add an align key to \startTABLE macro ...

\startTABLE has a optional argument which is passed down to \bTABLE

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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2010-11-13  5:47 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-11 18:44 table background color in first row Manfred Lotz
2010-11-11 19:13 ` Wolfgang Schuster
2010-11-11 19:40   ` Manfred Lotz
2010-11-11 19:56     ` Herbert Voss
2010-11-11 20:01       ` Manfred Lotz
2010-11-11 20:19         ` Manfred Lotz
2010-11-11 20:21         ` Wolfgang Schuster
2010-11-11 19:58     ` Wolfgang Schuster
2010-11-11 20:24       ` Manfred Lotz
2010-11-11 19:42   ` Herbert Voss
2010-11-11 19:45     ` Manfred Lotz
2010-11-11 19:45     ` Hans Hagen
2010-11-11 19:53       ` Herbert Voss
2010-11-11 21:54 ` Aditya Mahajan
2010-11-12 18:19   ` Hans Hagen
2010-11-12 18:24     ` Hans Hagen
2010-11-12 19:13     ` Wolfgang Schuster
2010-11-12 21:41       ` Aditya Mahajan
2010-11-13  5:47         ` Wolfgang Schuster
2010-11-12 21:38     ` Aditya Mahajan

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