ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Gerion Entrup <gerion.entrup@flump.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] How to specify a default formatting for TABLE
Date: Mon, 01 Jul 2024 23:56:19 +0200	[thread overview]
Message-ID: <3492953.QJadu78ljV@falbala> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1719 bytes --]

Hi,

I want to format a bunch a tables with the same formatting.
It seems that specifying the \setupTABLE commands as part of the preamble works.

However, I need some tables that are formatted in another way.
Is there a generic way to specify this?

Here is a MWE:
```
\setupTABLE[frame=off, offset=2pt]
\setupTABLE[row][first][topframe=on, bottomframe=on, style=bf]
\setupTABLE[row][last][bottomframe=on]
\setupTABLE[row][even][background=color,backgroundcolor=red]

\setupcolors[state=start]

\starttext

A table:\\
\bTABLE
	\bTR \bTD head1 \eTD \bTD head2 \eTD \eTR
	\bTR \bTD data1 \eTD \bTD data2 \eTD \eTR
	\bTR \bTD data3 \eTD \bTD data4 \eTD \eTR
\eTABLE
\blank[line]

Another table with the same format:\\
\bTABLE
	\bTR \bTD head1 \eTD \bTD head2 \eTD \eTR
	\bTR \bTD data1 \eTD \bTD data2 \eTD \eTR
	\bTR \bTD data3 \eTD \bTD data4 \eTD \eTR
\eTABLE
\blank[line]

This table should be formatted in another way (actually not formatted):\\
\bTABLE
	\setupTABLE[row][each][topframe=off, bottomframe=off, style=, background=]
	\bTR \bTD head1 \eTD \bTD head2 \eTD \eTR
	\bTR \bTD data1 \eTD \bTD data2 \eTD \eTR
	\bTR \bTD data3 \eTD \bTD data4 \eTD \eTR
\eTABLE
\blank[line]

This does not work either:\\
{
\setupTABLE[row][each][topframe=off, bottomframe=off, style=, background=]
% \setupTABLE[row][1,2,3][topframe=off, bottomframe=off, style=, background=] % this deactivates the color at least
\bTABLE
	\bTR \bTD head1 \eTD \bTD head2 \eTD \eTR
	\bTR \bTD data1 \eTD \bTD data2 \eTD \eTR
	\bTR \bTD data3 \eTD \bTD data4 \eTD \eTR
\eTABLE
}

\stoptext
```

The last two tables should be formatted as if the four setupTABLE commands in the header are not existent.
My solution does not work, however.

Gerion

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2024-07-01 21:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 21:56 Gerion Entrup [this message]
2024-07-01 22:17 ` [NTG-context] " Wolfgang Schuster
2024-07-01 22:23   ` Gerion Entrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3492953.QJadu78ljV@falbala \
    --to=gerion.entrup@flump.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).