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