ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Willi Egger via ntg-context <ntg-context@ntg.nl>
Cc: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>,
	Willi Egger <context@boede.nl>
Subject: Re: How to create cell data that spans four rows in a table?
Date: Sun, 9 Jan 2022 12:38:46 +0100	[thread overview]
Message-ID: <524cb5e7-10ee-55bb-d250-2be21a5b2d4b@gmail.com> (raw)
In-Reply-To: <14F9DC0B-DE38-423B-807B-6BFDCB1A0426@boede.nl>

Willi Egger via ntg-context schrieb am 08.01.2022 um 23:57:
> I would suggest not to use \starttable at all.
> 
> To me the most suitable table environment for such a table is \bTABLE \eTABLE. It gives you all kind of control over layout, dimensions, frames on and off etc.


I agree natural tables or extreme tables are the better choice for this 
table layout but it can be improved.


1. Keep the layout/settings local.

To ensure the \setupTABLE settings don't affect other tables you can 
either put \start and \stop at the begin and end of the table, e.g.

	\start
	\setupTABLE[...]
	\bTABLE
	...
	\eTABLE
	\stop

or put the settings in a setup-environment and load them on a pertable 
basis, e.g.

	\startsetups[fancytable]
	\setupTABLE[...]
	\stopsetups
	\bTABLE[setups=fancytable]
	...
	\eTABLE


2. Font changes are local to cells

When you apply a font switch to the whole content of a table cell there 
is no need to put braces around the text, e.g.

	\bTD \bf ... \eTD

can be used without problem. When you make this change for a table 
header and the result is bold text there is a even simpler method 
because a special cell type exists here, e.g.

	\bTH ... \eTH

creates bold text.


3. Simple markup

For natural tables with short texts in each cell there exists a simple 
mode which uses \starttable inspired markup with the short \NC and \NR 
commands to mark the start of each cell and row.

The example table of the OP can be written like below.

\starttext

\startsetups [tableframe]
     \setupTABLE [c] [1]    [leftframe=off,width=40mm]
     \setupTABLE [c] [2]    [rightframe=off, width=60mm]
     \setupTABLE [c] [each] [align={lohi,center}]
\stopsetups

\startTABLE[setups=tableframe]
\NC \bf Eons              \NC \bf Eras             \NC\NR
\NC Hadeon Eon            \NC                      \NC\NR
\NC[ny=4] Archanon Eon    \NC Eoarchean Era        \NC\NR
\NC                           Paleoarchean Era     \NC\NR
\NC                           Mesoarchean Era      \NC\NR
\NC                           Neoarchean Era       \NC\NR
\NC[ny=3] Proterozoic Eon \NC Paleoproterozoic Era \NC\NR
\NC                           Mesoproterozoic Era  \NC\NR
\NC                           Neoproterozoic Era   \NC\NR
\NC[ny=3] Phanerozoic Eon \NC Paleozoic Era        \NC\NR
\NC                           Mesozoic Era         \NC\NR
\NC                           Cenozoic Era         \NC\NR
\stopTABLE

\stoptext

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2022-01-09 11:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1716703798.1835455.1641677975773.ref@mail.yahoo.com>
2022-01-08 21:39 ` Joel via ntg-context
2022-01-08 22:57   ` Willi Egger via ntg-context
2022-01-09  3:51     ` Joel via ntg-context
2022-01-09 11:38     ` Wolfgang Schuster via ntg-context [this message]
2022-01-09  4:55   ` Aditya Mahajan via ntg-context

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=524cb5e7-10ee-55bb-d250-2be21a5b2d4b@gmail.com \
    --to=ntg-context@ntg.nl \
    --cc=context@boede.nl \
    --cc=wolfgang.schuster.lists@gmail.com \
    /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).