Graphics, Figures & TablesTables dont break lines.

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
cbeberge
Posts: 10
Joined: Sat Mar 13, 2010 3:03 pm

Tables dont break lines.

Post by cbeberge »

Hi

This code don't break the line. The text just fades out of the A4 paper to the right. Why?

Code: Select all

\begin{tabular}{| l | c | c |} \hline
\textbf{left} & \textbf{Middle} & \textbf{Right} \\ \hline
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh & jjjjjjjjjjjjjjjjjjjjjjjjjjjj &    fgdfdgdfg    \\
\end{tabular}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Tables dont break lines.

Post by Stefan Kottwitz »

Hi,

you could use p-columns to get columns of certain width where text in the p-cells would be wrapped, for instance:

Code: Select all

\begin{tabular}{| p{3cm} | c | c |}
Of course that should be breakable text like normal words, not like in your example.

To construct a table that fits the text width you could use tabularx, like:

Code: Select all

\usepackage{tabularx}
...
\begin{tabularx}{\textwidth}{| p{3cm} | p{4cm} | X |}
...
\end{tabularx}
Stefan
LaTeX.org admin
Post Reply