3

Although my table is only so wide and inside a alignment[middle] environment, it doesn’t get centered and stays left aligned. (For ConTeXtians: right aligned :))

I tried a hack and add an empty paragraph column, but empty columns appearantly get ignored.

What can I do?

1 Answer 1

3

Depends on which table environment you are using. With tables and natural tables, \midaligned centers the table:

\starttext
\midaligned
  {\startTABLE
    \NC A \NC B \NC C \NC \NR
    \NC A \NC B \NC C \NC \NR
    \NC A \NC B \NC C \NC \NR
    \NC A \NC B \NC C \NC \NR
  \stopTABLE}

\stoptext

or

\starttext
\midaligned
  {\starttable[|l|l|l|]
     \NC A \NC B \NC C \NC \AR
     \NC A \NC B \NC C \NC \AR
     \NC A \NC B \NC C \NC \AR
   \stoptable}

\stoptext 

There is no environment version of \midaligned, but you can easily create your own if you want:

\def\startmidaligned
    {\midaligned\bgroup}

\def\stopmidaligned
    {\egroup}          
4
  • I edited the question for which table I use. Something is wrong with your answer, though: You use TABLEs here, but the syntax of tables. natual TABLEs start like this: \bTABLE \bTR \bTD. Is there an environment for midaligned? Commented Aug 30, 2011 at 8:58
  • The TABLE macros also support the old style syntax. See context wiki. Using \midaligned also works with table macros.
    – Aditya
    Commented Aug 30, 2011 at 19:21
  • didn’t know the further, thanks! do you know what the difference between \midaligned and \startalignment[middle] is? Commented Aug 30, 2011 at 19:45
  • Roughly speaking, \midaligned{...} is equivalent to \hbox to equivalent to \raggedcenter, which in turn is equivalent to setting \leftflush` and \rightflush to 1fil.
    – Aditya
    Commented Aug 30, 2011 at 20:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .