Right-to-left natural tables

Hello, Are natural tables still the recommended table mechanism in ConTeXt? How can I get the order of cells in each row reversed (going from right to left)? \starttext \placetable{Caption} {\bTABLE \bTR \bTD One \eTD \bTD two \eTD \eTR \bTR \bTD Three \eTD \bTD fourteen \eTD \eTR \eTABLE} \setupalign[r2l] \placetable{Caption} {\bTABLE \bTR \bTD One \eTD \bTD two \eTD \eTR \bTR \bTD Three \eTD \bTD fourteen \eTD \eTR \eTABLE} \stoptext I expect the second table to completely mirror the first one. Though the cell contents (as well as the caption) are reversed, the order of cells in the row are the same as in the first table. For columns, we have a *direction* key, but I couldn't find anything like that for natural tables. Thanks for your help, Mohammad

Am 22.02.2025 um 23:07 schrieb Mohammad Hossein Bateni:
Hello,
Are natural tables still the recommended table mechanism in ConTeXt? How can I get the order of cells in each row reversed (going from right to left)?
It depends on your use but I tend to use either tabulate or extreme tables but whether you use extreme tables or natural tables is in many cases just a personal preference.
[...]
I expect the second table to completely mirror the first one. Though the cell contents (as well as the caption) are reversed, the order of cells in the row are the same as in the first table.
For columns, we have a /direction/ key, but I couldn't find anything like that for natural tables.
The column order is fixed on purpose and to change it Hans has to add an option for this, e.g. direction=reverse which isn't supported by any table type except the oldest \starttable environment. Wolfgang

Thanks, Hans! I see that the direction=reverse option works well in natural tables in the latest beta. I will play with it some more and report back if any errors are there. Documented here: https://wiki.contextgarden.net/Input_and_compilation/Languages/Right-to-left... Can you add the same support to tabulate which are a little less verbose? On Sun, Feb 23, 2025 at 6:01 AM Wolfgang Schuster < wolfgang.schuster.lists@gmail.com> wrote:
Am 22.02.2025 um 23:07 schrieb Mohammad Hossein Bateni:
Hello,
Are natural tables still the recommended table mechanism in ConTeXt? How can I get the order of cells in each row reversed (going from right to left)?
It depends on your use but I tend to use either tabulate or extreme tables but whether you use extreme tables or natural tables is in many cases just a personal preference.
[...]
I expect the second table to completely mirror the first one. Though the cell contents (as well as the caption) are reversed, the order of cells in the row are the same as in the first table.
For columns, we have a /direction/ key, but I couldn't find anything like that for natural tables.
The column order is fixed on purpose and to change it Hans has to add an option for this, e.g. direction=reverse which isn't supported by any table type except the oldest \starttable environment.
Wolfgang
___________________________________________________________________________________ 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
___________________________________________________________________________________

On 3/1/2025 1:08 PM, Mohammad Hossein Bateni wrote:
Thanks, Hans! I see that the direction=reverse option works well in natural tables in the latest beta. I will play with it some more and report back if any errors are there. Documented here: https://wiki.contextgarden.net/Input_and_compilation/ Languages/Right-to-left_RTL#Natural_Tables
Can you add the same support to tabulate which are a little less verbose?
can you explain "little less verbose" ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------

Two things I had in mind: - not having to write the end tags \eTD for each cell - ability to specify frames, etc. in the start line like \starttabulate[|CR{ red}c|CC{yellow}c|CM{green}c|CL{blue}c|] That said, I can stick to natural tables for all my needs. They seem to have all the features available. On Sun, Mar 2, 2025 at 7:50 AM Hans Hagen via ntg-context < ntg-context@ntg.nl> wrote:
On 3/1/2025 1:08 PM, Mohammad Hossein Bateni wrote:
Thanks, Hans! I see that the direction=reverse option works well in natural tables in the latest beta. I will play with it some more and report back if any errors are there. Documented here: https://wiki.contextgarden.net/Input_and_compilation/ Languages/Right-to-left_RTL#Natural_Tables
Can you add the same support to tabulate which are a little less verbose?
can you explain "little less verbose"
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
___________________________________________________________________________________ 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
___________________________________________________________________________________

Am 02.03.2025 um 20:50 schrieb Mohammad Hossein Bateni:
Two things I had in mind: - not having to write the end tags \eTD for each cell
https://wiki.contextgarden.net/Tables/Natural_tables_with_TABLE#TABLEs_with_...
- ability to specify frames, etc. in the start line like \starttabulate[|CR{red}c|CC{yellow}c|CM{green}c|CL{blue}c|]
You can use \setupTABLE to set values for whole rows and columns at the begin of the table. Wolfgang

On 2 Mar 2025, at 19:50, Mohammad Hossein Bateni
wrote: - not having to write the end tags \eTD for each cell
You could always put a wrapper around \doloopoverlist, e.g. \define\row#1{\doloopoverlist{#1}{\NC\recursestring}\NR} and then your table becomes \starttabulate \row{1,one,the first row} \row{2,two,the second row} % etc \stoptabulate If you want the Context source to look tabular as well then you could always create a template row using spaces for each cell, copy and paste in your editor to add as many rows as you need and then put the editor into overwrite mode so you can fill in the values without messing-up the column alignment. — Bruce Horrocks Hampshire, UK
participants (4)
-
Bruce Horrocks
-
Hans Hagen
-
Mohammad Hossein Bateni
-
Wolfgang Schuster