I was trying both break lines in the cells of my first column and in some column titles. I've tried the suggestion of using \pbox
. But it does not seem to work. I've looked already for some answers and I understand this might be interpreted as a duplicate -- but bear with me, it is really not working. Here is an example of the code that I've been working with:
Observation: I've been trying to do this table in the beamer type of document. One of the answers, though being really helpful, does not work with that type of document -- so I will make it explicit in the code right now. Also, I've have corrected the name of the columns, which weren't in the right order.
\documentclass{beamer}
\usepackage{multirow,bigstrut}
\begin{document}
\frame
{
\frametitle{Table 1}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
\textbf{Product} & \textbf{Company}} & \textbf{Temperature} & \textbf{Observations} & \textbf{\pbox{2cm}{Temperature Test\\on Hot Water}} & \textbf{Temperature Test on Cold Water} & \textbf{Consistency} \bigstrut\\
\hline
\multirow{2}[4]{*}{\pbox{2cm}{Product \\ 1}} & Company 1 & 13.5 & 84 & 1000.5 & 1000.7 & 1000.8 \bigstrut\\
\cline{2-7} & Company 2 & 14.3 & 71 & 1000.2 & 1000.9 & 1000.12 \bigstrut\\
\hline
\end{tabular}%
}
end{document}
l
,c
orr
will never break on its own. You'll have to do this manually, or use an alternative column specification (likep{<len>}
).\begin{tabular}{p{2cm}}
it would break after 2cm?*
and use\multirow{2}[4]{2cm}{\centering Product \\ 1}