... Thanks for the answer but -
- I generated a macro just do demonstrate different behavior in row #1 depending on whether
settings for columns were specified for a PARTICULAR column
("\setupTABLE[column][2][...]") or for columns IN GENERAL
("\setupTABLE[column][][...]").
I need the case with a particular column settings to work:
----
\starttext
\bTABLE
\setupTABLE[width=2cm]
\setupTABLE[column][2][align=flushright]
\setupTABLE[row][1][align=middle] % Settings for ALL columns in the row 1
should be overwritten; but are not (?!)
\bTABLEhead[align=middle]
\bTR
\bTH[align=middle] a\eTH
\bTH[align=middle] b\eTH
\eTR
\eTABLEhead
\bTABLEbody
\bTR
\bTD a\eTD
\bTD b\eTD
\eTR
\eTABLEbody
\eTABLE
\stoptext
----
You can see that "\setupTABLE[row][1][align=middle]" doesn't affect column #2, which
keeps its previously setting "\setupTABLE[column][2][align=flushright]"; this is unwanted.
I'd need "\setupTABLE[row][1][align=middle]" to overwrite the column #2
setting, so that all columns in the row #1 be mid-aligned.
Lukas
On Wed, 03 Oct 2012 10:53:39 +0200, Wolfgang Schuster
<wolfgang.schus...@gmail.com> wrote:
Am 03.10.2012 um 10:16 schrieb Procházka Lukáš Ing. - Pontex s. r. o.
<l...@pontex.cz>:
Hello,
I have a complicated TABLE, but I simplified it to the following example:
----
\def\DoTable#1{%
\bTABLE
\setupTABLE[width=2cm]
\setupTABLE[column][#1][align=flushright] %
....................................................... [1]
\setupTABLE[row][1][align=middle] % Settings for ALL columns in the row 1
should be overwritten ... [2]
\bTABLEhead
\bTR
\bTH a\eTH
\bTH b\eTH
\eTR
\eTABLEhead
\bTABLEbody
\bTR
\bTD a\eTD
\bTD b\eTD
\eTR
\eTABLEbody
\eTABLE
}
\starttext
No column specification: \DoTable{}
With column specification: \DoTable{2}
\stoptext
----
The problem is that row #1 should be mid-aligned in all columns. So I wrote:
----
\setupTABLE[column][2][align=flushright] % Column #2 has its own alignment...
\setupTABLE[row][1][align=middle] % ... but overwrite here for the whole row
#1 (including column #2)
----
But column #2 keeps the previously assigned alignment.
The situation doesn't change even if I swap [1] and [2] (for the case "the earlier
setting, the higher priority").
Moreover, if the column number if not specified (\DoTable{}), the row setting
overwrites setting for ALL columns; so only if the column is specified
precisely, its setting is kept.
So how to overwrite row #1 setting globally?
And how setting priorities are evaluated? I guessed the later specification,
the higher weight (which would allow overwriting)...
Note that in the example it would be possible to specify settings for each
row/column, but it not useful way in the case of more/very complicated tables.
\def\DoTable
{\dosingleempty\DodoTable}
\def\DodoTable[#1]%
{\bgroup
\setupTABLE[width=2cm]%
\doifsomething{#1}{\setupTABLE[column][#1][align=flushright]}%
\setupTABLE[header][align=middle]%
\bTABLE
\bTABLEhead
\bTR
\bTH a\eTH
\bTH b\eTH
\eTR
\eTABLEhead
\bTABLEbody
\bTR
\bTD a\eTD
\bTD b\eTD
\eTR
\eTABLEbody
\eTABLE
\egroup}
\starttext
No column specification: \DoTable
With column specification: \DoTable[2]
\stoptext
Wolfgang
--
Ing. Lukáš Procházka [mailto:l...@pontex.cz]
Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4
Tel: +420 244 062 238
Fax: +420 244 461 038
___________________________________________________________________________________
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 : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________