[Tex/LaTex] Table column fixed width does not fire

line-breakingsv-classestables

I have the springer svjour3 template and the user guide says that for tables the usual Latex 2e commands are used.

Now, I would like to produce a table that goes over the whole page (the error is the same, no matter whether I choose the one or the two column setup) with three columns of 6cm width. Inside the cells the text should be line broken automatically.

% For tables use
\begin{table*}
% table caption is above the table
\caption{Please write your table caption here}
\label{tab:1}       % Give a unique label
% For LaTeX tables use
\begin{tabular}{ p{5 cm} l p{5 cm} l p{5 cm} }
\hline\noalign{\smallskip}
first & second & third  \\
\noalign{\smallskip}\hline\noalign{\smallskip}
number & Some very very long text. And even more longer text in this column. & number \\
number & number & Some very very long text. And even more longer text in this column. \\
\noalign{\smallskip}\hline
\end{tabular}
\end{table*}

The problem is that no matter how I manipulate the arguments to the tabular commands, I can produce the desired 5cm for one column only, the rest would ignore it and just get as long as it gets and run out of the pdf page. What could cause this?

Best Answer

Your l column specification is causing this: p{5cm} will fix the width of that column to 5cm and break the lines as expected. However, l, r and c columns do not break.

You may be interested in using the tabularx package's tabularx environment rather. It provides an X column specification that breaks (like p{<len>}), but spreads out to fill some pre-specified width. The usage resembles

\begin{tabularx}{\linewidth}{p{5cm}Xp{5cm}}
  % Your tabular stuff here
\end{tabularx}

In the above code snippet, the table will be \linewidth wide, with the X-column filling up whatever is left of \linewidth-10cm (and some column spacing).