ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: table background color in first row
Date: Fri, 12 Nov 2010 16:38:04 -0500 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.01.1011121633530.27225@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <4CDD8532.4050407@wxs.nl>

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
___________________________________________________________________________________


      parent reply	other threads:[~2010-11-12 21:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11 18:44 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 message]

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.LNX.2.01.1011121633530.27225@ybpnyubfg.ybpnyqbznva \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    /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).