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 to create a table whose width should be the minimum possible (lines don't wrap). I see that tabularx wants a width parameter, is it possible to specify something like "auto", instead, for example, of \linewidth?

share|improve this question
10  
that is done by a simple tabular environment –  Herbert Sep 11 '12 at 13:42
    
@Herbert I guess that should be made the answer:-) –  David Carlisle Dec 13 '12 at 0:18
add comment

1 Answer

\begin{tabular}{l r c}
foo & bar & and so on
\end{tabular}

is a tabular with a minimum width and default column separation width

\begin{tabular}{@{} l r c @{}}
foo & bar & and so on
\end{tabular}

is a tabular with no column separation on the left and right

{\setlength\tabcolsep{0pt}%
\begin{tabular}{l r c}
foo & bar & and so on
\end{tabular}}

is a tabular with no column separation anyway

\begin{tabular}{l @{} r c }
foo & bar & and so on
\end{tabular}

is a tabular with no column separation between the first and second column

\begin{tabular}{l @{\hspace{5mm}} r c }
foo & bar & and so on
\end{tabular}

is a tabular with a column separation of 5mm between the first and second column

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