From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/27360 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: TABLE 'last line' tag? Date: Fri, 21 Apr 2006 21:51:46 +0200 Message-ID: <444937D2.6040906@wxs.nl> References: <4447BBC9.1040607@elvenkind.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1145649125 29954 80.91.229.2 (21 Apr 2006 19:52:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Apr 2006 19:52:05 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Apr 21 21:52:03 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1FX1fc-00064Z-FH for gctc-ntg-context-518@m.gmane.org; Fri, 21 Apr 2006 21:52:00 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D70C3127B3; Fri, 21 Apr 2006 21:51:59 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14199-03-3; Fri, 21 Apr 2006 21:51:54 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 27386127A0; Fri, 21 Apr 2006 21:51:54 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 925BA127A0 for ; Fri, 21 Apr 2006 21:51:53 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14199-03-2 for ; Fri, 21 Apr 2006 21:51:52 +0200 (CEST) Original-Received: from mail.pragma-ade.net (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with SMTP id 9B8461279F for ; Fri, 21 Apr 2006 21:51:52 +0200 (CEST) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 13516 for ; Fri, 21 Apr 2006 23:51:52 +0400 User-Agent: Thunderbird 1.5 (Windows/20051201) Original-To: mailing list for ConTeXt users In-Reply-To: X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:27360 Archived-At: nico wrote: > On Thu, 20 Apr 2006 17:27:50 -0700, Johannes Graumann > wrote: > > >> nico wrote: >> >> >>> Why don't you test if the attribute is set before applying it to the TR? >>> You see the problem on the last row, but the fact is that you force the >>> bottomframe clear for every row (which is dirty IMHO). >>> >> It's not that easy, since the bottomframe - once set - is persistent ... >> so >> every row underneath my header (e.g.) will have 'bottomframe=on' set. >> > > No, the options are local to the current level where it is set. If > bottomframe is on for one row, it won't set bottomframe to the next rows. > In the following example, only two rows (the header and another one in the > body) have local bottomframe on, and the last row bottomframe is done with > table setup: > > \starttext > \setupTABLE[frame=off] > \setupTABLE[row][last][rulethickness=0.90pt,bottomframe=on] > \bTABLE > \bTABLEhead > \bTR[bottomframe=on]\bTH a \eTH\bTH b \eTH\eTR > \eTABLEhead > \bTABLEbody > \bTR\bTD bla \eTD\bTD bla \eTD\eTR > \bTR\bTD bla \eTD\bTD bla \eTD\eTR > \bTR\bTD bla \eTD\bTD bla \eTD\eTR > \bTR[bottomframe=on]\bTD bla \eTD\bTD bla \eTD\eTR > \bTR\bTD bla \eTD\bTD bla \eTD\eTR > \bTR\bTD bla \eTD\bTD bla \eTD\eTR > \eTABLEbody > \eTABLE > \stoptext > > You can also put bottomframe only for a cell with > bTD[bottomframe=on]...\eTD. > the following patch will permit negative numbers (remove empty lines due to mail mess up) \def\setupTBLcell#1#2% cell over col over row {\setupTBLsection % already forgotten \edef\positiverow{\number#1}% \edef\positivecol{\number#2}% \scratchcounter-\maximumrow\advance\scratchcounter#1\advance\scratchcounter\minusone \edef\negativerow{\number\scratchcounter}% \scratchcounter-\maximumcol\advance\scratchcounter#2\advance\scratchcounter\minusone \edef\negativecol{\number\scratchcounter}% \getvalue{\@@tblprefix\v!each\v!each}% \getvalue{\@@tblprefix\c!y\v!each}% \getvalue{\@@tblprefix\c!x\v!each}% \getvalue{\@@tblprefix\c!y\v!oddeven\positiverow}% \getvalue{\@@tblprefix\c!x\v!oddeven\positivecol}% \getvalue{\@@tblprefix\c!x\v!oddeven\positivecol\c!y\v!oddeven\positiverow}% \ifnum\positiverow=\plusone \getvalue{\@@tblprefix\c!y\v!first}% \executeifdefined{\@@tblprefix\c!x\positivecol\c!y\v!first}\donothing \fi \ifnum\positivecol=\plusone \getvalue{\@@tblprefix\c!x\v!first}% \executeifdefined{\@@tblprefix\c!x\v!first\c!y\positiverow}\donothing \fi \ifnum\positiverow=\maximumrow\relax \getvalue{\@@tblprefix\c!y\v!last}% \executeifdefined{\@@tblprefix\c!x\positivecol\c!y\v!last}\donothing \fi \ifnum\positivecol=\maximumcol\relax \getvalue{\@@tblprefix\c!x\v!last}% \executeifdefined{\@@tblprefix\c!x\v!last\c!y\positiverow}\donothing \fi \ifnum\positiverow=\maximumrow\relax\ifnum\positivecol=\maximumcol\relax \getvalue{\@@tblprefix\c!x\v!last\c!y\v!last}% \fi\fi \ifnum\positiverow=\plusone \ifnum\positivecol=\plusone \getvalue{\@@tblprefix\c!x\v!first\c!y\v!first}% \fi\fi \ifnum#1>\noftblhdnxlines\else \executeifdefined{\@@tblprefix\v!header\v!each}\donothing \executeifdefined{\@@tblprefix\v!header\positivecol}\donothing \fi \executeifdefined{\@@tblprefix\c!y\positiverow}\donothing \executeifdefined{\@@tblprefix\c!y\negativerow}\donothing \getvalue{\@@tbl\@@tbl\c!extras}\letvalue{\@@tbl\@@tbl\c!extras}\relax % \executeifdefined{\@@tblprefix\c!x\positivecol}\donothing \executeifdefined{\@@tblprefix\c!x\negativecol}\donothing \getvalue{\@@tbl\@@tbl\c!extras}\letvalue{\@@tbl\@@tbl\c!extras}\relax % \executeifdefined{\@@tblprefix\c!x\positivecol\c!y\positiverow}\donothing \executeifdefined{\@@tblprefix\c!x\negativecol\c!y\negativerow}\donothing \global\letcscsname\@@tblsplitafter\csname\@@tbl\@@tbl\c!after\endcsname \relax} \setupcolors[state=start] \setupTABLE[r] [2][color=red] \setupTABLE[r] [-2][color=red] \setupTABLE[c] [2][color=green] \setupTABLE[c] [-2][color=green] \setupTABLE[4] [4][color=blue] \setupTABLE[-4][-4][color=blue] \bTABLE \dorecurse{10}{\bTR \dorecurse{6}{\bTD xxx \eTD} \eTR} \eTABLE \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------