2

I want to have table, for instance with 3 columns, where the first two columns will have natural width, so the text doesn't wrap and the last column will wrap if the whole table will be bigger than text width. Is it possible in latex?

--------------------------------------- // line
| a | asfafasf | asfasfasff           |
| b | saf      | asafasfsafasfasfasfs |
| c | safasf   | asasffsaf asfasf     |
|   |          | asasfsafaf           |
Krab
  • 477
  • tabular* and tabularx take a width argument. But maybe a p-column might be more suited. Always hard to say, when the example contains just random strings of letters. – Johannes_B May 02 '15 at 09:28

1 Answers1

2

tabularx can do this job with its X column. I have added \raggedright so the complex words don't trouble.

\documentclass{article}
\usepackage{tabularx}
\begin{document}
  \noindent
  \begin{tabularx}{\textwidth}{ll>{\raggedright\arraybackslash}X}
     a & asfafasf & asfasfasff          \\
     b & saf      & asafasfsafasfasfasfs \\
     c  & safasf   & asasffsaf asfasf asasfsafaf   asasfsafaf   asasfsafaf   asasfsafaf   asasfsafaf   asasfsafaf   asasfsafaf   asasfsafaf        \\
  \end{tabularx}
\end{document}

enter image description here

David Carlisle
  • 757,742