9

How can I put a new line (line break) within a table cell? I'm at a loss how to do this. I'm not using lyx or anything special, just MacTex and texmaker.

10

The cell needs to be of a paragraph style: either via a p{<len>} column specification, or using a \parbox.

enter image description here

\documentclass{article}
\begin{document}

\begin{tabular}{ll}
  Some text & Some more text \\
  \parbox[t]{3in}{Here is some lengthy text \par with a break\strut} &
  Some more text \\
  Some text & Some more text
\end{tabular}

\bigskip

\begin{tabular}{p{3in}l}
  Some text & Some more text \\
  Here is some lengthy text \par with a break\strut &
  Some more text \\
  Some text & Some more text
\end{tabular}

\end{document}

Using \\ alone would not help, since this is redefined inside a tabular to define a new line. Of course, depending on the context, it may also be possible to use

\begin{tabular}{ll}
  Some text & Some more text \\
  Here is some lengthy text & Some more text \\
  with a break \\
  Some text & Some more text
\end{tabular}

which resembles a newline in one of the cells.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.