How to insert manual line breaks inside LaTeX tables?

I know that if you define the width in a table column, you can get automatic word wrap. However, I need to control where new rows should appear in a specific cell in the table.

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

+12
latex
source share
3 answers

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

+26
source share

You can do it as follows:

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

which produces:

enter image description here

+9
source share

This can be achieved with \newline . Since there was no fragment sample in the accepted answer, here is a working sample:

  \begin{tabular}{p{2cm} p{10cm}} \em{Programming} \textsc{languages} & Java, Node.js, Python, Clojure \\ \newline & \newline \\ \em{Development systems} & Concurrent Programming, Design Patterns \end{tabular} 
+2
source share

All Articles