ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Tables, Row Span, and Colors
@ 2015-03-12 17:37 Troy Henderson
  2015-03-13 12:11 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Troy Henderson @ 2015-03-12 17:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

The following code produces my table, but I could not get the text "Region"
to span rows 3-7.  So, I would like


   1. the word "Region" to be inside the table and not "hacked" in the way
   that I have it.
   2. to make the (spanned) cell containing "Years" have a gray background.
   3. to make each of the "column heading" cells (i.e., the ones containing
   "<1", "1-2", ..., "15+", and "Total" to have a gray background.
   4. to have the (spanned) cell containing "Region" (from #1) have a gray
   background.
   5. 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.

Thanks in advance,

Troy

—— Code Starts Here ——

\setupcolors[state=start]
\starttext
    \null\vskip15ex
    \hskip1em\framed[orientation=90,frame=off]{\bf
Region}\blank\vskip-25.5ex
    \starttable[|c|l|r|r|r|r|r|r|r|]
        \DC \DC \DL[7] \DR
        \NC \NC \VL \use{7}\ReFormat[cB]{Years} \VL \AR
        \DC \DC \DL[7] \DR
        \NC \NC \VL \ReFormat[cB]{$<1$} \VL \ReFormat[cB]{$1-2$} \VL
\ReFormat[cB]{$3-4$} \VL \ReFormat[cB]{$5-9$} \VL \ReFormat[cB]{$10-14$}
\VL \ReFormat[cB]{$15+$} \VL \ReFormat[cB]{Total} \VL \AR
        \HL
%        \VL \offset[y=8ex]{\framed[orientation=90,frame=off]{\bf Region}}
\VL East \VL 32 \VL 54 \VL 59 \VL 112 \VL 77 \VL 118 \VL 452 \VL \AR
        \VL \null\hskip2em\null \VL {\bf East} \VL 32 \VL 54 \VL 59 \VL 112
\VL 77 \VL 118 \VL 452 \VL \AR
        \VL \VL {\bf Midwest} \VL 31 \VL 68 \VL 68 \VL 120 \VL 63 \VL 173
\VL 523 \VL \AR
        \VL \VL {\bf South} \VL 53 \VL 92 \VL 93 \VL 158 \VL 106 \VL 158
\VL 660 \VL \AR
        \VL \VL {\bf West} \VL 41 \VL 56 \VL 67 \VL 78 \VL 45 \VL 86 \VL
373 \VL \AR
        \DC \DL[8] \DR
        \VL \VL {\bf Total} \VL 157 \VL 270 \VL 287 \VL 468 \VL 291 \VL 535
\VL 2008 \VL \AR
        \HL
    \stoptable
\stoptext

[-- Attachment #1.2: Type: text/html, Size: 2326 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
___________________________________________________________________________________

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

* Re: Tables, Row Span, and Colors
  2015-03-12 17:37 Tables, Row Span, and Colors Troy Henderson
@ 2015-03-13 12:11 ` Wolfgang Schuster
  2015-03-13 23:27   ` Troy Henderson
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2015-03-13 12:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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

* Re: Tables, Row Span, and Colors
  2015-03-13 12:11 ` Wolfgang Schuster
@ 2015-03-13 23:27   ` Troy Henderson
  2015-03-14  5:48     ` Otared Kavian
  0 siblings, 1 reply; 5+ messages in thread
From: Troy Henderson @ 2015-03-13 23:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Thank you Wolfgang.  The attached PDF is the output I get from using your
code.

This is LuaTeX, Version beta-0.79.2 (TeX Live 2015/dev) (rev 5084)

Troy

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

[-- Attachment #2: foo.pdf --]
[-- Type: application/pdf, Size: 13643 bytes --]

[-- Attachment #3: 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
___________________________________________________________________________________

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

* Re: Tables, Row Span, and Colors
  2015-03-13 23:27   ` Troy Henderson
@ 2015-03-14  5:48     ` Otared Kavian
  2015-03-15  2:20       ` Troy Henderson
  0 siblings, 1 reply; 5+ messages in thread
From: Otared Kavian @ 2015-03-14  5:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 515 bytes --]

> On 14 Mar 2015, at 00:27, Troy Henderson <thenders@gmail.com> wrote:
> 
> Thank you Wolfgang.  The attached PDF is the output I get from using your code.
> 
> This is LuaTeX, Version beta-0.79.2 (TeX Live 2015/dev) (rev 5084)

Hi Troy,

With Wolfgang’s code, the attached PDF is what I get with 
	ConTeXt  ver: 2015.03.10 12:09 MKIV beta  fmt: 2015.3.11  int: english/english
Here it doesn’t show the problem you noticed.
It may happen that the code you used missed something.

Best regards: OK

[-- Attachment #2: table-row-span.pdf --]
[-- Type: application/pdf, Size: 13611 bytes --]

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




[-- Attachment #4: 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
___________________________________________________________________________________

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

* Re: Tables, Row Span, and Colors
  2015-03-14  5:48     ` Otared Kavian
@ 2015-03-15  2:20       ` Troy Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Troy Henderson @ 2015-03-15  2:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Updating ConTeXt minimals fixed my problem.  Thank you.

Troy

[-- Attachment #1.2: Type: text/html, Size: 106 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
___________________________________________________________________________________

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

end of thread, other threads:[~2015-03-15  2:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-12 17:37 Tables, Row Span, and Colors Troy Henderson
2015-03-13 12:11 ` Wolfgang Schuster
2015-03-13 23:27   ` Troy Henderson
2015-03-14  5:48     ` Otared Kavian
2015-03-15  2:20       ` Troy Henderson

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