проблема с многорядным текстом: текст выходит за пределы ячейки

проблема с многорядным текстом: текст выходит за пределы ячейки

Стол

Как показано на прикрепленном изображении, текст выходит за пределы ячейки. Я был бы признателен, если бы кто-нибудь помог мне решить эту проблему.

\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}

решение1

Просто добавьте еще две линии, чтобы компенсировать длину, выходящую за пределы ячейки. И отрегулируйте количество multirow{x}{width}{content}так, чтобы они выровнялись по верху.

введите описание изображения здесь

\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}

решение2

multirowА что если вообще не использовать ?

\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}

введите описание изображения здесь

С другой стороны, я бы использовал схему «выравнивания по верху»:

\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}

введите описание изображения здесь

А еще лучше, я бы также использовал 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}

введите описание изображения здесь

решение3

Спасибо за предложение. Изменив количество строк, мне удалось создать красиво отформатированную таблицу, как показано на рисунке.

введите описание изображения здесь

\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}

Связанный контент