ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Natural Tables, backgroundcolor, and frames
@ 2008-05-04 21:22 Brian R. Landy
  2008-05-05  7:04 ` Wolfgang Schuster
  0 siblings, 1 reply; 2+ messages in thread
From: Brian R. Landy @ 2008-05-04 21:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

I actually posted this last summer, but never got a reply and did not  
have a chance to follow up.  When using natural tables, a cell with  
backgroundcolor enabled will overwrite the topframe/rightframe from  
the cell to the left/above.  A workaround could be to always use  
topframe/leftframe.  However this workaround is not possible with  
tables with split=repeat that span multiple pages, since you cannot  
know which rows on pages beyond the first for which you should set  
topframe=on.

The below code demonstrates the problem for color w/ bottomframe  
specified for the header --

\setupcolors[state=start]
\definecolor[ice][r=0.867, g=0.945, b=0.973, s=0.9]
\starttext
\bTABLE[split=repeat,frame=off,background=color]
\bTABLEhead
\bTR[bottomframe=on]
\bTH A \eTH \bTH B \eTH
\eTR
\eTABLEhead
\bTABLEbody
\dorecurse{25}{\bTR[backgroundcolor=ice] \bTD a \eTD \bTD b \eTD \eTR  
\bTR \bTD a \eTD \bTD b \eTD \eTR}
eTABLEbody
\eTABLE
\stoptext

I tested this at http://live.contextgarden.net.  Does anyone have a  
solution?  One thought I had was to insert a very thin row  (with  
height set to rulethickness) at the bottom of the header, but with  
split=repeat it appears that the table forces a minimum height to a  
row, so it is too tall.

Thanks,
Brian
___________________________________________________________________________________
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] 2+ messages in thread

* Re: Natural Tables, backgroundcolor, and frames
  2008-05-04 21:22 Natural Tables, backgroundcolor, and frames Brian R. Landy
@ 2008-05-05  7:04 ` Wolfgang Schuster
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster @ 2008-05-05  7:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, May 4, 2008 at 11:22 PM, Brian R. Landy <brian@landy.cx> wrote:
> Hi,
>
> I actually posted this last summer, but never got a reply and did not
> have a chance to follow up.  When using natural tables, a cell with
> backgroundcolor enabled will overwrite the topframe/rightframe from
> the cell to the left/above.  A workaround could be to always use
> topframe/leftframe.  However this workaround is not possible with
> tables with split=repeat that span multiple pages, since you cannot
> know which rows on pages beyond the first for which you should set
> topframe=on.
>
> The below code demonstrates the problem for color w/ bottomframe
> specified for the header --
>
> \setupcolors[state=start]
> \definecolor[ice][r=0.867, g=0.945, b=0.973, s=0.9]

\startuseMPgraphic{headerrule}
linecap := butt ;
draw (-1.5*\the\linewidth,0)--(OverlayWidth+1.5*\the\linewidth,0) ;
setbounds currentpicture to unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
\stopuseMPgraphic

\defineoverlay[headerrule][\useMPgraphic{headerrule}]

> \starttext
> \bTABLE[split=repeat,frame=off,background=color]
> \bTABLEhead
> \bTR[bottomframe=on]

\bTR[background=headerrule,backgroundoffset=-\linewidth]

> \bTH A \eTH \bTH B \eTH
> \eTR
> \eTABLEhead
> \bTABLEbody
> \dorecurse{25}{\bTR[backgroundcolor=ice] \bTD a \eTD \bTD b \eTD \eTR
> \bTR \bTD a \eTD \bTD b \eTD \eTR}
> eTABLEbody
> \eTABLE
> \stoptext
>
> I tested this at http://live.contextgarden.net.  Does anyone have a
> solution?  One thought I had was to insert a very thin row  (with
> height set to rulethickness) at the bottom of the header, but with
> split=repeat it appears that the table forces a minimum height to a
> row, so it is too tall.

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] 2+ messages in thread

end of thread, other threads:[~2008-05-05  7:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-04 21:22 Natural Tables, backgroundcolor, and frames Brian R. Landy
2008-05-05  7:04 ` 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).