ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Bart C. Wise" <bntgcontext@wiseguysweb.com>
To: ntg-context@ntg.nl
Subject: Re: Questions about tables
Date: Thu, 22 Jan 2009 13:27:57 -0700	[thread overview]
Message-ID: <200901221327.57408.bntgcontext@wiseguysweb.com> (raw)
In-Reply-To: <bb8b59590901211716n37fa405eu714a88b3436bf3e0@mail.gmail.com>


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

On Wednesday 21 January 2009 06:16:36 pm Cecil Westerhof wrote:
> I have the following table:
> \starttable[|cp(.12\textwidth)|cp(.12\textwidth)|cp(.18\textwidth)|cp(.18\t
>extwidth)|cp(.12\textwidth)|cp(.12\textwidth)|cp(.12\textwidth)|] \HL
> \CL[darkyellow]\SR
> \VL Verwerkt \VL Datum \VL Km-stand \VL Kilometers \VL c/l \VL Liter
> \VL Prijs \VL \SR
> \HL
> \VL          \VL       \VL          \VL            \VL     \VL
> \VL       \VL \SR
> \HL
> \stoptable
>
> There are two problems with it:
> - The horizontal line at the top disappears because of the color. Is
> there a way to get it back?
> - The table is on the right side of the paper. How can I get it
> centered on the page?
>
> Also is it possible to let the rows fill the complete page? I mean: if
> there is room for 40 rows, that there are automatically 40 rows.

Cecil,

Here's a stab.  It uses a macro that Wolfgang wrote on getting the line count 
to automatically populate the page.  However, there's one caveat, I could not 
start the table at the beginning of the page, I had to put a ".\par" in first.  
Other than that, it works.

\setupcolors[state=start]                                               
\showframe                                                              

\def\TEntry#1#2#3#4#5#6{
    \bTR                
        \bTD #1 \eTD    
        \bTD #2 \eTD    
        \bTD #3 \eTD    
        \bTD #4 \eTD    
        \bTD #5 \eTD    
        \bTD #6 \eTD    
    \eTR                
}                       

\setupTABLE[c][each][align=middle,height=\lineheight]
\setupTABLE[r][1][background=color,backgroundcolor=darkyellow]
\setupTABLE[c][each][width=0.12\textwidth]
\setupTABLE[c][3,4][width=0.18\textwidth]

\starttext
.\par
\startalignment[middle]
\dontleavehmode
\bTABLE
    \bTR
        \bTD Verwerkt \eTD
        \bTD Datum \eTD
        \bTD Km-stand \eTD
        \bTD Kilometers \eTD
        \bTD c/l \eTD
        \bTD Liter \eTD
    \eTR
    \getnoflines{\dimexpr\pagegoal-\pagetotal-3\lineheight\relax}%
    \dorecurse{\noflines}{\TEntry{}{}{}{}{}{}}
\eTABLE
\stopalignment
\stoptext

Bart


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

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

  parent reply	other threads:[~2009-01-22 20:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22  1:16 Cecil Westerhof
2009-01-22  9:43 ` Cecil Westerhof
2009-01-22 19:33   ` Willi Egger
2009-01-22 20:27 ` Bart C. Wise [this message]
2009-01-22 20:58   ` Wolfgang Schuster

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=200901221327.57408.bntgcontext@wiseguysweb.com \
    --to=bntgcontext@wiseguysweb.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).