I'm using the tabularx
and makecell
packages for the aesthetics of my tables. I used the X
column type for columns with long texts and \makecell{...}
for line-breaks into the cells. But when I try to use both together, the effect of the X
columns doesn't work.
In the MWE I'd like that the long text um the 3rd line of the 1st row and last column breaks automatically. Any help?
\documentclass{article}
\usepackage{tabularx}
\usepackage{blindtext}
\usepackage{booktabs}
\usepackage{makecell}
\begin{document}
\begin{table}[h]
\footnotesize
\centering
\caption{Table's caption}%
\label{tab:Example}%
\begin{tabularx}{\linewidth}{lcX}%
\toprule
\textbf{Head 1} & \textbf{Head 2} & \textbf{Head 3} \\
\midrule
Row 1 & 1 & \makecell[lt]{Line 1\\Line 2\\\blindtext} \\
Row 2 & 2 & \makecell[lt]{Line 1\\Line 2\\Line 3} \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
\newline
or a blank line for a new paragraph) why\makecell
?\makecell
is for cases like table headings where you only want forced line breaks and there is no automatic breaking)p
columns so you can do anything in an X column that you can do in a standard tabularp
column.