Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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}          
share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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