I need a short table that I have to add to my document. I'm afraid, LaTeX does not seem to break the lines at the spaces. My table currently looks like that:
\begin{table}[!ht]
\centering
\begin{tabular}{|c|c|c|}\hline
\textbf{Column 1} & \textbf{Column 2} & \textbf{Column 3} \\\hline
This is a very long text which has to be broken into the next line & This is a very long text which has to be broken into the next line & This is a very long text which has to be broken into the next line \\\hline
This is a very long text which has to be broken into the next line & This is a very long text which has to be broken into the next line & This is a very long text which has to be broken into the next line \\\hline
This is a very long text which has to be broken into the next line & This is a very long text which has to be broken into the next line & This is a very long text which has to be broken into the next line \\\hline
\end{tabular}
\caption{This is the caption}
\end{table}
Does anybody know a quick way to fix this?
Best Answer
I suggest you use a
tabularx
environment, with its width set to\textwidth
, and use a modified version of theX
column type so that the columns' contents are centered rather than fully justified.