ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Tables, Row Span, and Colors
Date: Fri, 13 Mar 2015 13:11:16 +0100	[thread overview]
Message-ID: <ECF3C478-5155-4AE5-B2A2-729FEA3E0674@gmail.com> (raw)
In-Reply-To: <CAFP+xFL3ypFOUnQ7VqnBgXm8t=O-hAfxr9yL1KdBW=Qj=P0xkw@mail.gmail.com>


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


> Am 12.03.2015 um 18:37 schrieb Troy Henderson <thenders@gmail.com>:
> 
> The following code produces my table, but I could not get the text "Region" to span rows 3-7.  So, I would like
> 
> the word "Region" to be inside the table and not "hacked" in the way that I have it.
> to make the (spanned) cell containing "Years" have a gray background.
> to make each of the "column heading" cells (i.e., the ones containing "<1", "1-2", ..., "15+", and "Total" to have a gray background.
> to have the (spanned) cell containing "Region" (from #1) have a gray background.
> to have the "row heading" cells (i.e., the ones containing "East", Midwest", "South", "West", and "Total") have a gray background.
> I would appreciate any help in attaining this wish list.
> 
You can use natural tables or xtables to achieve this layout.

\starttext

\startsetups[table:layout]
	\setupTABLE [start]      [frame=off,leftframe=on,rightframe=on,align=flushright,width=4em,loffset=.25em,roffset=.25em]
	\setupTABLE [y]   [1,2]  [foregroundstyle=bold,background=screen,align=middle,frame=on]
	\setupTABLE [x]   [1,2]  [foregroundstyle=bold,background=screen,frame=on]
	\setupTABLE [1,2] [1,2]  [background=,frame=off,leftframe=off,rightframe=off]
	\setupTABLE [x]   [1]    [align={middle,lohi},width=2em]
	\setupTABLE [x]   [2]    [align=flushleft,width=6em]
	\setupTABLE [y]   [last] [frame=on]
\stopsetups

\bTABLE[setups=table:layout]
	\bTR
		\bTD \eTD
		\bTD \eTD
		\bTD[nx=7] Years \eTD
	\eTR
	\bTR
		\bTD \eTD
		\bTD \eTD
		\bTD \m{<1} \eTD
		\bTD \m{1-2} \eTD
		\bTD \m{3-4} \eTD
		\bTD \m{5-9} \eTD
		\bTD \m{10-14} \eTD
		\bTD \m{15+} \eTD
		\bTD Total \eTD
	\eTR
	\bTR
		\bTD[ny=5] \rotate[rotation=90]{Region} \eTD
		\bTD East \eTD
		\bTD 32 \eTD
		\bTD 54 \eTD
		\bTD 59 \eTD
		\bTD 112 \eTD
		\bTD 77 \eTD
		\bTD 118 \eTD
		\bTD 452 \eTD
	\eTR
	\bTR
		\bTD Midwest \eTD
		\bTD 31 \eTD
		\bTD 68 \eTD
		\bTD 68 \eTD
		\bTD 120 \eTD
		\bTD 63 \eTD
		\bTD 173 \eTD
		\bTD 523 \eTD
	\eTR
	\bTR
		\bTD South \eTD
		\bTD 53 \eTD
		\bTD 92 \eTD
		\bTD 93 \eTD
		\bTD 158 \eTD
		\bTD 106 \eTD
		\bTD 158 \eTD
		\bTD 660 \eTD
	\eTR
	\bTR
		\bTD West \eTD
		\bTD 41 \eTD
		\bTD 56 \eTD
		\bTD 67 \eTD
		\bTD 78 \eTD
		\bTD 45 \eTD
		\bTD 86 \eTD
		\bTD 373 \eTD
	\eTR
	\bTR
		\bTD Total \eTD
		\bTD 157 \eTD
		\bTD 270 \eTD
		\bTD 287 \eTD
		\bTD 468 \eTD
		\bTD 291 \eTD
		\bTD 535 \eTD
		\bTD 2008 \eTD
	\eTR
\eTABLE

\stoptext

Wolfgang


[-- Attachment #1.2: Type: text/html, Size: 8480 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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
___________________________________________________________________________________

  reply	other threads:[~2015-03-13 12:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-12 17:37 Troy Henderson
2015-03-13 12:11 ` Wolfgang Schuster [this message]
2015-03-13 23:27   ` Troy Henderson
2015-03-14  5:48     ` Otared Kavian
2015-03-15  2:20       ` Troy Henderson

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=ECF3C478-5155-4AE5-B2A2-729FEA3E0674@gmail.com \
    --to=schuster.wolfgang@gmail.com \
    --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).