ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* rotated headers in natural tables
@ 2023-03-15 18:15 Henning Hraban Ramm via ntg-context
  2023-03-15 22:27 ` fv leung via ntg-context
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2023-03-15 18:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Henning Hraban Ramm

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

Hraban
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: rotated headers in natural tables
  2023-03-15 18:15 rotated headers in natural tables 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
  2023-03-17 13:03 ` Wolfgang Schuster via ntg-context
  2 siblings, 1 reply; 5+ messages in thread
From: fv leung via ntg-context @ 2023-03-15 22:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: fv leung


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

How about using \vfill ?

\define[1]{\RtH}{\vfill\rotate{#1}}

Henning Hraban Ramm via ntg-context <ntg-context@ntg.nl> 於 2023年3月16日 週四
上午2:16寫道:

> 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
>
> Hraban
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 2479 bytes --]

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

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: rotated headers in natural tables
  2023-03-15 18:15 rotated headers in natural tables Henning Hraban Ramm via ntg-context
  2023-03-15 22:27 ` fv leung via ntg-context
@ 2023-03-15 23:32 ` Bruce Horrocks via ntg-context
  2023-03-17 13:03 ` Wolfgang Schuster via ntg-context
  2 siblings, 0 replies; 5+ messages in thread
From: Bruce Horrocks via ntg-context @ 2023-03-15 23:32 UTC (permalink / raw)
  To: ntg-context mailing list; +Cc: Bruce Horrocks

\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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: rotated headers in natural tables
  2023-03-15 18:15 rotated headers in natural tables Henning Hraban Ramm via ntg-context
  2023-03-15 22:27 ` fv leung via ntg-context
  2023-03-15 23:32 ` Bruce Horrocks via ntg-context
@ 2023-03-17 13:03 ` Wolfgang Schuster via ntg-context
  2 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2023-03-17 13:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henning Hraban Ramm via ntg-context
  Cc: Wolfgang Schuster

Henning Hraban Ramm via ntg-context schrieb am 15.03.2023 um 19:15:
> 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

You can change the vertical alignment in a framed (and therefore also
natural tables and extreme tables) with align=high, align=low and 
align=lohi.

\bTR[align={middle,low},strut=no]
     \bTH \dontleavehmode\rotate{animal} \eTH
     \bTH \dontleavehmode\rotate{size} \eTH
     \bTH \dontleavehmode\rotate{weight} \eTH
     \bTH \dontleavehmode\rotate{average speed} \eTH
\eTR

\dontleavehmode is only needed when you set horizontal alignment
(align=middle) and strut=no ensures there is no extra space at the bottom
of the cells (remove the setting to see the difference).

Wolfgang

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: rotated headers in natural tables
  2023-03-15 22:27 ` fv leung via ntg-context
@ 2023-03-20 19:22   ` Henning Hraban Ramm via ntg-context
  0 siblings, 0 replies; 5+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2023-03-20 19:22 UTC (permalink / raw)
  To: ntg-context; +Cc: Henning Hraban Ramm

Am 15.03.23 um 23:27 schrieb fv leung via ntg-context:
> How about using \vfill ?
> 
> \define[1]{\RtH}{\vfill\rotate{#1}}

This is actually the only version that works flawlessly.

But thanks for all answers! (I was busy over the weekend.)

Hraban

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-20 19:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 18:15 rotated headers in natural tables 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
2023-03-17 13:03 ` Wolfgang Schuster via ntg-context

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).