# problem with multirow: text runs out of a cell bound

As shown in the attached picture, text runs out of the cell bound. I'd appreciate it if someone could help me fix the problem.

\begin{table}[!htbp]
\centering
\caption{Experiment outline}
\label{tab:exp_process}
\begin{tabular}{|l|l|l|m{6cm}|}
\hline
Sessions & Objectives & Groups & Activities
\\
\hline\hline
\multirow{2}{*}{$1$st session} &
\multirow{2}{4cm}{Learning the basics of thermal conduction} &
Control &
\multirow{1}{6cm}{Solve a thermal system design problem using a real-time high-fidelity simulation with the CPU heat sink system}
\\
&                            & Experimental &
\\
\hline
\end{tabular}
\end{table}


## 3 Answers

Simply add two more lines to compensate the the length that out of the cell. And adjust the number of multirow{x}{width}{content} so that they align on the top.

\documentclass[]{article}%
\usepackage[margin=1cm]{geometry}
\usepackage{multirow,array}
\begin{document}
\begin{table}[!htbp]
\centering
\caption{Experiment outline}
\label{tab:exp_process}
\begin{tabular}{|l|l|l|m{6cm}|}
\hline
Sessions & Objectives & Groups & Activities \\ \hline\hline
\multirow{1}{*}{$1$st session} & \multirow{2}{4cm}{Learning the basics of thermal conduction} &    Control &
\multirow{1}{6cm}{Solve a thermal system design problem using a real-time high-fidelity simulation with the CPU heat sink system}
\\
&           &     Experimental &   \\
&           &                  &   \\
&           &                  &   \\ \hline
\end{tabular}
\end{table}
\end{document}


What about not using multirow at all?

\documentclass{article}
\usepackage{array}
\begin{document}
\noindent
\begin{tabular}{|m{2cm}|m{3.5cm}|m{2.5cm}|m{5cm}|}
\hline
Sessions & Objectives & Groups & Activities \\
\hline\hline
First session &
Learning the basics of thermal conduction &
Control\newline Experimental &
Solve a thermal system design problem using a real-time
high-fidelity simulation with the CPU heat sink system \\
\hline
\end{tabular}
\end{document}


On the other hand, I'd use a “top aligned” scheme:

\documentclass{article}
\usepackage{array}
\begin{document}
\noindent
\begin{tabular}{|l|p{3.5cm}|p{2.5cm}|p{5cm}|}
\hline
Sessions & Objectives & Groups & Activities \\
\hline\hline
First session &
Learning the basics of thermal conduction &
Control\newline Experimental &
Solve a thermal system design problem using a real-time
high-fidelity simulation with the CPU heat sink system \\
\hline
\end{tabular}
\end{document}


Better yet, I'd also use booktabs:

\documentclass{article}
\usepackage{array,booktabs}
\begin{document}
\noindent
\begin{tabular}{l p{3.5cm} p{2.5cm} p{5cm}}
\toprule
Sessions & Objectives & Groups & Activities \\
\midrule
First session &
Learning the basics of thermal conduction &
Control\newline Experimental &
Solve a thermal system design problem using a real-time
high-fidelity simulation with the CPU heat sink system \\
\bottomrule
\end{tabular}
\end{document}


Thank you for the suggestion. By tweaking numbers of lines, I was able to produce a nicely formatted table as shown in the picture.

\begin{table}[!htbp]
\centering
\caption{Experiment outline}
\label{tab:exp_process}
\begin{tabular}{|m{2cm}|m{4cm}|m{2.5cm}|m{6cm}|}
\hline
Sessions & Objectives & Groups & Activities \\ \hline\hline
\multirow{3}{*}{$1$st session} & \multirow{3}{4cm}{Learning the basics of thermal conduction} &
\multirow{2}{*}{Control} &
\multirow{3}{6cm}{Solve a thermal system design problem using a real-time high-fidelity simulation with the CPU heat sink system}
\\
&           &     \multirow{2}{*}{Experimental} &   \\
&           &                  &   \\ \hline
\end{tabular}
\end{table}