ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* wie helpt met gekleurde tabel...
@ 1998-07-23 13:18 W.H. Dekker
  0 siblings, 0 replies; 2+ messages in thread
From: W.H. Dekker @ 1998-07-23 13:18 UTC (permalink / raw)


Colored table are too difficult for me, yet. I'm tryin g to generate a
table from Perl with cells containing numbers >2 colored light gray,
and cells with numbers >3 colored dark gray.

In the following example, lines 1, 2, 3 and 5 should contain colored
cells.  Line 1 is OK, line 2, with the same treatment, stays white,
line 3 is OK again and line 5 stays white.

Can anybody explain? 

Another problem: the second column is numerical, and this works. But
if I replace the next c-key with N[00.0], things go wrong.

\starttable[{
|    l     | N[00.0] | |     c   | |     c      |   }] \HL
%
\VL        \VL\use5  \JustCenter Laboratory no. \VL\SR
%%%\VL     \DL[5]                                  \NR     % does not work
\VL method \VL  1    \VL\VL  2    \VL\VL  3     \VL\SR \HL
%
\BC        \BL[r,.7] \BC\BC       \BL[r,.9]        \FR     % line
\VL PO     \VL 25.5  \VL\VL -0.0  \VL\VL -2.8   \VL\FR     % 1
%
\BC        \BL[r,.9] \BC\BC       \BL[r,.7]        \MR     % line
\VL FFA    \VL -2.2  \VL\VL -0.3  \VL\VL  3.3   \VL\MR     % 2
%
\BC        \BL[r,.9] \BC\BC       \BC\BC           \MR     % line
\VL Ranci  \VL  2.3  \VL\VL  0.7  \VL\VL  0.6   \VL\MR     % 3 
\VL NMR 20 \VL  1.9  \VL\VL  0.7  \VL\VL -1.0   \VL\LR \HL % line 4
%
\VL        \VL\use5  \JustCenter Laboratory no. \VL\SR
\VL method \VL  6    \VL\VL  5    \VL\VL 6      \VL\SR \HL
%
\BC        \BC       \BC\BL[r,.9] \BC              \FR     % line 
\VL PO     \VL  1.4  \VL\VL  2.4  \VL\VL        \VL\FR     % 5
%
\VL FFA    \VL  0.5  \VL\VL -0.8  \VL\VL        \VL\MR     % line 6
%
\VL Ranci  \VL -0.5  \VL\VL       \VL\VL        \VL\MR     % line 7
%
\VL NMR 20 \VL -0.4  \VL\VL       \VL\VL        \VL\LR \HL % line 8
\stoptable
\stoptext

-- 
Kind regards,
Wybo
===================Servalys Analytical Chemistry Services=================
Wybo H. Dekker        | Deilsedijk 60                 | tel (31)345-652164
wybo@servaly.hobby.nl | 4158 CH Deil, The Netherlands | fax (31)345-652383


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

* Re: wie helpt met gekleurde tabel...
@ 1998-07-23 15:45 Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 1998-07-23 15:45 UTC (permalink / raw)
  Cc: ntg-context

Hello Wybo,

> Colored table are too difficult for me, yet. I'm tryin g to generate a
> table from Perl with cells containing numbers >2 colored light gray,
> and cells with numbers >3 colored dark gray.

Coloring is very difficult in Tables, and depends on a lot of trickery. 

> Can anybody explain?

I'll look at it later.

> Another problem: the second column is numerical, and this works. But
> if I replace the next c-key with N[00.0], things go wrong.

Hm. I'll look at it. 

======================= Now how about this one ====================

\unexpanded\def\Check#1
  {\stelomlijndin        % let op de spatie achter #1
     [kader=uit,         % let op het gebruik van \inlijnd
      hoogte=passend,
      offset=1pt,
      breedte=2.5em,
      uitlijnen=links,
      achtergrond=raster]%
   \hfill
   \ifdim#1pt=0pt
     % forget about it
   \else\ifdim#1pt>2pt
     \inlijnd[achtergrondraster=.9]{\strut$#1$}%
   \else\ifdim#1pt>8pt
     \inlijnd[achtergrondraster=.7]{\strut$#1$}%
   \else
     \inlijnd[achtergrond=]{\strut$#1$}%
   \fi\fi\fi}

\def\JC{\JustCenter}

\starttabel[|l|f{\Check}|f{\Check}|f{\Check}|]
\HL
\VL \LOW{method} \VL \use3 \JC Laboratory no.  \VL\SR
\DC              \DL[3]                           \DR
\VL              \VL \JC 1 \VL \JC 2 \VL \JC 3 \VL\SR
\HL
\VL PO           \VL 25.5  \VL -0.0  \VL -2.8  \VL\FR
\VL FFA          \VL -2.2  \VL -0.3  \VL  3.3  \VL\MR
\VL Ranci        \VL  2.3  \VL  0.7  \VL  0.6  \VL\MR
\VL NMR 20       \VL  1.9  \VL  0.7  \VL -1.0  \VL\LR
\HL
\VL \LOW{method} \VL \use3 \JC Laboratory no.  \VL\SR
\DC              \DL[3]                           \DR
\VL              \VL \JC 6 \VL \JC 5 \VL \JC 6 \VL\SR
\HL
\VL PO           \VL  1.4  \VL  2.4  \VL 0     \VL\FR
\VL FFA          \VL  0.5  \VL -0.8  \VL 0     \VL\MR
\VL Ranci        \VL -0.5  \VL  0    \VL 0     \VL\MR
\VL NMR 20       \VL -0.4  \VL  0    \VL 0     \VL\LR
\HL
\stoptabel

=================================================================

Knowing you, you can also generate this by your script. (Putting \Check
for each entry is also possible, or putting whatever command in a cell;
ask if you don't understand what I'm saying.) 

That way you can also put rules around an entry or even pictures behind
them. 

Hans
Hans

-----------------------------------------------------------------
                                              Hans Hagen | PRAGMA
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | fax: 038 477 53 74 | mail: pragma@wxs.nl
-----------------------------------------------------------------


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

end of thread, other threads:[~1998-07-23 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-07-23 13:18 wie helpt met gekleurde tabel W.H. Dekker
1998-07-23 15:45 Hans Hagen

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