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?

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}          
  • 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? – flying sheep Aug 30 '11 at 8:58
  • The TABLE macros also support the old style syntax. See context wiki. Using \midaligned also works with table macros. – Aditya Aug 30 '11 at 19:21
  • didn’t know the further, thanks! do you know what the difference between \midaligned and \startalignment[middle] is? – flying sheep Aug 30 '11 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 Aug 30 '11 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.