ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Bruce Horrocks via ntg-context <ntg-context@ntg.nl>
To: ntg-context mailing list <ntg-context@ntg.nl>
Cc: Bruce Horrocks <ntg@scorecrow.com>
Subject: Re: rotated headers in natural tables
Date: Wed, 15 Mar 2023 23:32:38 +0000	[thread overview]
Message-ID: <08703B32-71DB-4E24-8612-00472EC7BD44@scorecrow.com> (raw)
In-Reply-To: <6d711cbf-fd4b-c0b1-d36c-4599c12db912@fiee.net>

\setupTABLE inherits from \setupframed which has an orientation option.

So \bTR[orientation=90] on the header row should do it, with the content specified normally i.e. without using \RtH.

A quick test on one of my tables showed some issues with alignment so you may need to fix the 'width' (now the height) of the cells rather than let it be calculated by contents.

> On 15 Mar 2023, at 18:15, Henning Hraban Ramm via ntg-context <ntg-context@ntg.nl> wrote:
> 
> Hi!
> 
> In my table, I want the header texts to be 90˚ rotated and aligned to the bottom of their cell. I couldn’t find an option to do that.
> Tried \dontleavehmode or \hfill in my \RtH macro to no avail.
> Is it possible?
> 
> 
> \define[1]{\RtH}{\rotate{#1}}
> 
> \starttext
> 
> \setupTABLE[offset=3pt]
> \setupTABLE[header][background=color,backgroundcolor=yellow,align=bottom]
> \bTABLE
> \bTABLEhead
> \bTR \bTH\RtH{animal}\eTH \bTH\RtH{size}\eTH \bTH\RtH{weight}\eTH \bTH\RtH{average speed}\eTH \eTR
> \eTABLEhead
> \bTABLEbody
> \bTR \bTD sparrow \eTD \bTD small \eTD \bTD light \eTD \bTD high \eTD \eTR
> \bTR \bTD dog \eTD \bTD medium \eTD \bTD medium \eTD \bTD medium \eTD \eTR
> \bTR \bTD snail \eTD \bTD small \eTD \bTD light \eTD \bTD slow \eTD \eTR
> \bTR \bTD elephant \eTD \bTD big \eTD \bTD heavy \eTD \bTD medium \eTD \eTR
> \eTABLEbody
> \eTABLE
> 
> \stoptext
> 

—
Bruce Horrocks
Hampshire, UK

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2023-03-15 23:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 18:15 Henning Hraban Ramm via ntg-context
2023-03-15 22:27 ` fv leung via ntg-context
2023-03-20 19:22   ` Henning Hraban Ramm via ntg-context
2023-03-15 23:32 ` Bruce Horrocks via ntg-context [this message]
2023-03-17 13:03 ` Wolfgang Schuster 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=08703B32-71DB-4E24-8612-00472EC7BD44@scorecrow.com \
    --to=ntg-context@ntg.nl \
    --cc=ntg@scorecrow.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).