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.

I would like if possible using array environment, to align the last column of my array to the right and at the end of the page. Something like that:

\begin{array}{\textwidth}{l r}
   first column & second column
\end{array}

But of course this does not work. Does anyone know how to achieve this ? Thanks in advance.

share|improve this question
    
Why do you need the environment array? You can use the environment tabularx provided by the package tabularx. –  Marco Daniel Apr 2 '12 at 12:36
    
Usually I only write math in my array, so I find it annoying to have to put some '$' in each case of my array. But this is right that I don't absolutly need the array package. –  Archimondain Apr 2 '12 at 12:44
add comment

1 Answer

up vote 6 down vote accepted
\usepackage{array}

then

\noindent
\begin{tabular*}{\textwidth}{>{$}l<{$}@{\extracolsep{\fill}}>{$}r<{$}@{}}
...

.

will push the last column over to the right, and use math mode as for an array environmen.

share|improve this answer
    
It does flush the array to the right, but I would like only the last column to be flushed on the right –  Archimondain Apr 2 '12 at 12:46
    
answer updated for this case –  David Carlisle Apr 2 '12 at 12:51
    
Awesome, thanks a lot –  Archimondain Apr 2 '12 at 12:54
add comment

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.