[Tex/LaTex] How to add a forced line break inside a table cell


I have some text in a table and I want to add a forced line break. I want to insert a forced line break without having to specify the column width, i.e. something like the following:

Foo bar & Foo <forced line break here> bar & Foo bar \\

I know that \\ inserts a line break in most cases, but here it starts a new table row instead.

A similar question was asked before: How to break a line in a table

Best Answer

Strangely, no answer (unless I've misread them) mentions a package that is dedicated to this precise question: makecell, which allows for common formatting of certain cells, thanks to its \thead and \makecell commands, and for line breaks inside these cells. The horizontal and vertical alignments can chosen independently from those of the table they're included in. The default is cc, but you can change it globally in the preamble with


where v is one of t,c,b and h one of l,c,r. Alternatively, for a single cell, you can use the \makecell or \thead commands with the optional argument [vh].

So here is a demo:




    \begin{tabular}{ | c | c | c |}
      \thead{A Head} & \thead{A Second \\ Head} & \thead{A Third \\ Head} \\
      Some text &  \makecell{Some really \\ longer text}  & Text text text  \\


Compiled MWE