ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Questions about tables
@ 2009-01-22  1:16 Cecil Westerhof
  2009-01-22  9:43 ` Cecil Westerhof
  2009-01-22 20:27 ` Bart C. Wise
  0 siblings, 2 replies; 5+ messages in thread
From: Cecil Westerhof @ 2009-01-22  1:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I have the following table:
\starttable[|cp(.12\textwidth)|cp(.12\textwidth)|cp(.18\textwidth)|cp(.18\textwidth)|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 Westerhof
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Questions about tables
  2009-01-22  1:16 Questions about tables Cecil Westerhof
@ 2009-01-22  9:43 ` Cecil Westerhof
  2009-01-22 19:33   ` Willi Egger
  2009-01-22 20:27 ` Bart C. Wise
  1 sibling, 1 reply; 5+ messages in thread
From: Cecil Westerhof @ 2009-01-22  9:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

2009/1/22 Cecil Westerhof <cldwesterhof@gmail.com>:
> 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?

That is only on screen. When printed, it is there.


> - The table is on the right side of the paper. How can I get it
> centered on the page?

With a lot of experimenting, I am a lot further further. See the atached file.


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

There is even room for 43 rows. I do need to place them all by hand? I
tried \dorecurse, but that did not work.
Especially when the highlight is changed (now every five rows) this
would be a lot of work.

It is a little strange. The second page is reasonably placed. But the
first page not. Why is the layout of the first page different?

Tips to get the tables better in the middle and use more of the
available space are welcome.

I have a strange problem. When printing the first page, or the second
page, there is no problem. Put when I try to print the complete
document. The printer is busy a long time. At a certain point the
printer is 'ready', but does not have printed the document. Anybody
knows what could be happening?
I am working with openSUSE and a HP Color LaserJet 1600.

I also tried to make the document singlesided. But when I then placed
two tables, they got on different pages instead of beside eachother.
How would I place two tables beside eachother on singlesided paper?

-- 
Cecil Westerhof

[-- Attachment #2: fuel.tex --]
[-- Type: application/x-tex, Size: 4998 bytes --]

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

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

* Re: Questions about tables
  2009-01-22  9:43 ` Cecil Westerhof
@ 2009-01-22 19:33   ` Willi Egger
  0 siblings, 0 replies; 5+ messages in thread
From: Willi Egger @ 2009-01-22 19:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

Hi Cecil,

You could use \showframe before starttext, then you will see the  
relations of the areas. Here I do not see that the placement of the  
table is incorrect.

I tried to use \doerecurse with the table-environment and I also did  
not get a result.

A possibility is to use another table environment:

\bTABLE
	\bTR
		\bTD  ... \eTD
	\eTR
\eTABLE

This environment has more possibilities than \starttable. Herein  
\dorecurse does work. Moreover support for colouring is more  
advanced. Look for details in the enattab.pdf

I suggest you to use buffers for the content that the loops typeset.

A sample is in your fuel.tex

Willi

[-- Attachment #2: fuel.tex --]
[-- Type: application/octet-stream, Size: 3395 bytes --]

\setuppapersize[A5][A4]
\setuparranging[2UP,rotated,doublesided]
\setuplayout
  [backspace=20mm,footer=5mm,header=5mm,height=middle,margin=1cm,topspace=0mm,width=middle,location=middle]
\setupindenting[yes,none]
\enableregime[utf-8]
\setupcolors[state=start]
\mainlanguage[nl]
\setupbodyfont[roman,7pt]
\setuppagenumbering[location=] 
\setupoutput[pdf]
% \gdef\@colorHeader{darkyellow}
% \gdef\@colorHighlightRow{lightgray}


% \startbuffer[Table]
%   \starttable[|Bcp(.10\textwidth)|Bcp(.10\textwidth)|Bcp(.15\textwidth)|Bcp(.15\textwidth)|Bcp(.10\textwidth)|Bcp(.10\textwidth)|Bcp(.10\textwidth)|]
%   \HL
%   \CL\yellow\SR
%   \VL Verwerkt \VL Datum \VL Km-stand \VL Kilometers \VL c/l \VL Liter \VL Prijs \VL \AR
%   \HL                                                                                 
%   \VL          \VL       \VL          \VL            \VL     \VL       \VL       \VL \AR
%   \HL                                                                                 
%   \VL          \VL       \VL          \VL            \VL     \VL       \VL       \VL \AR
%   \HL                                                                                 
%   \VL          \VL       \VL          \VL            \VL     \VL       \VL       \VL \AR
%   \HL                                                                                 
%   \VL          \VL       \VL          \VL            \VL     \VL       \VL       \VL \AR
%   \HL
%   \CL\screen\LR
% \stoptable
% \stopbuffer

% \startbuffer[Rows]
% \VL          \VL       \VL          \VL            \VL     \VL       \VL       \VL \AR
%  \HL
%  \VL          \VL       \VL          \VL            \VL     \VL       \VL       \VL \AR
%  \HL
%  \VL          \VL       \VL          \VL            \VL     \VL       \VL       \VL \AR
%  \HL
%  \VL          \VL       \VL          \VL            \VL     \VL       \VL       \VL \AR
%  \HL
%  \CL\screen \AR
% \stopbuffer

\startbuffer[Rows]
\bTR
	\bTD \strut \eTD
	\bTD \strut \eTD
	\bTD \strut \eTD
	\bTD \strut \eTD
	\bTD \strut \eTD
	\bTD \strut \eTD
	\bTD \strut \eTD
\eTR
\stopbuffer
\showframe
\starttext

% \dorecurse{4}{
% \starttable[|Bcp(.10\textwidth)|Bcp(.10\textwidth)|Bcp(.15\textwidth)|Bcp(.15\textwidth)|Bcp(.10\textwidth)|Bcp(.10\textwidth)|Bcp(.10\textwidth)|]
%   \HL
%   \VL Verwerkt \VL Datum \VL Km-stand \VL Kilometers \VL c/l \VL Liter \VL Prijs \VL \FR
%   \HL
%   \VL          \VL       \VL          \VL            \VL     \VL       \VL       \VL \AR
%   \HL                                                                                
%   \VL          \VL       \VL          \VL            \VL     \VL       \VL       \VL \AR
%   \HL                                                                                
%   \VL          \VL       \VL          \VL            \VL     \VL       \VL       \VL \AR
%   \HL                                                                                
%   \VL          \VL       \VL          \VL            \VL     \VL       \VL       \VL \AR
%   \HL
% % \dorecurse{4}{\getbuffer[Rows]}
% \stoptable
% \page}

\setupTABLE[r][each][width=.14\textwidth,align=middle]
\dorecurse{4}
{\bTABLE
	\bTR
		\bTD Verwerkt 	\eTD
		\bTD Datum		\eTD
		\bTD Km-stand 	\eTD
		\bTD Kilometers \eTD
		\bTD c/l        \eTD
		\bTD Liter      \eTD
		\bTD Prijs      \eTD
	\eTR
	\dorecurse{4}{\getbuffer[Rows]}	
\eTABLE
\page}
\stoptext

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



On Jan 22, 2009, at 10:43 AM, Cecil Westerhof wrote:

> 2009/1/22 Cecil Westerhof <cldwesterhof@gmail.com>:
>> 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?
>
> That is only on screen. When printed, it is there.
>
>
>> - The table is on the right side of the paper. How can I get it
>> centered on the page?
>
> With a lot of experimenting, I am a lot further further. See the  
> atached file.
>
>
>> 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.
>
> There is even room for 43 rows. I do need to place them all by hand? I
> tried \dorecurse, but that did not work.
> Especially when the highlight is changed (now every five rows) this
> would be a lot of work.
>
> It is a little strange. The second page is reasonably placed. But the
> first page not. Why is the layout of the first page different?
>
> Tips to get the tables better in the middle and use more of the
> available space are welcome.
>
> I have a strange problem. When printing the first page, or the second
> page, there is no problem. Put when I try to print the complete
> document. The printer is busy a long time. At a certain point the
> printer is 'ready', but does not have printed the document. Anybody
> knows what could be happening?
> I am working with openSUSE and a HP Color LaserJet 1600.
>
> I also tried to make the document singlesided. But when I then placed
> two tables, they got on different pages instead of beside eachother.
> How would I place two tables beside eachother on singlesided paper?
>
> -- 
> Cecil  
> Westerhof<fuel.tex>___________________________________________________ 
> ________________________________
> 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
> ______________________________________________________________________ 
> _____________


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

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

* Re: Questions about tables
  2009-01-22  1:16 Questions about tables Cecil Westerhof
  2009-01-22  9:43 ` Cecil Westerhof
@ 2009-01-22 20:27 ` Bart C. Wise
  2009-01-22 20:58   ` Wolfgang Schuster
  1 sibling, 1 reply; 5+ messages in thread
From: Bart C. Wise @ 2009-01-22 20:27 UTC (permalink / raw)
  To: ntg-context


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

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

* Re: Questions about tables
  2009-01-22 20:27 ` Bart C. Wise
@ 2009-01-22 20:58   ` Wolfgang Schuster
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2009-01-22 20:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 22.01.2009 um 21:27 schrieb Bart C. Wise:

> 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.
>
> \starttext
> .\par


Use the following to remove the gap at the top of the page.

\dontleavehmode\vskip-\dimexpr\lineheight+\topskip\relax\par

Wolfgang

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


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

end of thread, other threads:[~2009-01-22 20:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-22  1:16 Questions about tables Cecil Westerhof
2009-01-22  9:43 ` Cecil Westerhof
2009-01-22 19:33   ` Willi Egger
2009-01-22 20:27 ` Bart C. Wise
2009-01-22 20:58   ` Wolfgang Schuster

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