# ConTeXt: How to maximize width of column depending on fixed sizes of other columns?

In LaTex, I could do something like:

\newcolumntype{C}[1]
{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}

\newcolumntype{L}[1]
{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\newcolumntype{R}[1]
{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}

\begin{longtabu} to \linewidth
{R{3cm} | X[l] | L{2cm}}
...
\end{longtabu}


and, as a result, the central column would take what's left of the page after right and left columns are forced to occupy fixed width. How to do the same in ConTeXt?

• propably off topic but isn't there a way to set the middle column width to something like \dimexpr\linewidth-3cm-2cm\relax? – user4686 Nov 18 '13 at 17:26

I don't exactly know what the longtable macros do. I am guessing what you want, and here is one alternative.

\startsetups table:align
\setupTABLE[column][1][width=3cm, align=flushright]
\setupTABLE[column][3][width=2cm, align=flushleft]
\stopsetups

\starttext

\startTABLE[setups={table:align}]
\NC One \NC \input ward \NC Two \NC \NR
\stopTABLE

\stoptext


which gives

• Can this be used with tables, a multi-page table? – Alexander Shukaev Nov 18 '13 at 20:15
• Oh, I've just noticed that tables are deprecated, and that TABLE is recommended. Can you confirm that? Do you recommend me to go with TABLE for a multi-page table? – Alexander Shukaev Nov 18 '13 at 20:23
• Yes. You need to add \startTABLE[split=yes] for multipage tables. The only drawback of using TABLE for multi-page tables is that the table only splits at the end of a row; it is not possible to split a table inside a row. – Aditya Nov 18 '13 at 20:53