tags:

views:

53

answers:

2

I know that if you define a width in a table's column, you can get automatic word-wrapping. However, I need to control where newlines should happen in a specific table cell.

Thus, how can I insert manual line breaks in a LaTeX table cell?

+2  A: 

You could do it like this:

\documentclass{report}

\begin{document}

\begin{tabular}{|l|l|}
  \hline
  A & B \\ 
    & C \\ 
  \hline
  D & E \\
  \hline
\end{tabular}

\end{document}

which produces:

alt text

Bart Kiers
Not what I am looking for but this could be a workaround.
ssn
+5  A: 

Usually, you use a column definition like p{3cm} instead of l, and then use \newline instead of \\ in the cell body.

Kilian Foth
Could you post an example? I couldn't get a `\newline` to work within a cell of a table...
Bart Kiers
Kilian Foth
@Kilian, I will try that later. Thanks!
Bart Kiers