'How can I wrap text into one specific cell of my table in Latex?
I have been working on this one table but the text of one cell refuses to wrap inside it and I can't figure why.
This is the code:
\setlength{\arrayrulewidth}{0.5mm}
\setlength{\tabcolsep}{16pt}
\renewcommand{\arraystretch}{1.5}
\begin{table}[H]
\begin{tabular}{|p{0.35\linewidth}|p{0.6\linewidth}|}
\hline
\multicolumn{1}{|c|}{\textbf{Control Variable}} & \textbf{Use}
\\ \hline
Number of COVID-19 cases & \\ \cline{1-1}
Number of COVID-19 related deaths & \multirow{-2}{*}{Used as proxies for the level of contagion each country was experiencing.}
\\ \hline
Overall Government Response Index & Records how response of governments has varied over all indicators in the database, becoming stronger or weaker over course of the outbreak.
\\ \hline
Stringency Index & Records strictness of ‘lockdown style’ policies that restrict behavior
\\
\hline
Economic Index & Records measures such as income support and debt relief \\
\hline
GDP per capita (current USD) & \cellcolor Used as a proxy for development. \\
\hline
Literacy rate, adult total (percentage of people ages 15 and above) & Percentage of people age 15+ who can read and write with understanding a short simple statement about their everyday life.
\\
\hline
Physicians (per 1000 people) & \\ \cline{1-1}
Hospital beds (per 1000 people) &
\\ \cline{1-1}
Nurses and midwives (per 1000 people) & \multirow{-3}{*}{Used as proxies for the strength of the health system.} \\
\hline
Critical Fatality Rate & The Critical Fatality Rate (CFR) is the ratio between the total number of cases and the total number of deaths from a determined illness, which in this case is COVID-19. This is a measure of the pandemic’s impact. \\
\hline
\end{tabular}
\caption{Table detailing all control variables and the purpose for including them}
\label{table:1}
\end{table}
This is the result:

The line I couldn't wrap is:
\multirow{-2}{*}{Used as proxies for the level of contagion each country was experiencing.}
How can I fix it?
Solution 1:[1]
The tabularray package makes merging cells a piece of cake:
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{table}[htbp]
\begin{tblr}{
colspec={|X[valign=h]|X[valign=m]|},
row{1}={font=\bfseries},
cell{1}{1}={halign=c}
}
\hline
Control Variable & Use
\\ \hline
Number of COVID-19 cases & \SetCell[r=2]{} Used as proxies for the level of contagion each country was experiencing. \\ \cline{1-1}
Number of COVID-19 related deaths &
\\ \hline
Overall Government Response Index & Records how response of governments has varied over all indicators in the database, becoming stronger or weaker over course of the outbreak.
\\ \hline
Stringency Index & Records strictness of ‘lockdown style’ policies that restrict behavior
\\
\hline
Economic Index & Records measures such as income support and debt relief \\
\hline
GDP per capita (current USD) & Used as a proxy for development. \\
\hline
Literacy rate, adult total (percentage of people ages 15 and above) & Percentage of people age 15+ who can read and write with understanding a short simple statement about their everyday life.
\\
\hline
Physicians (per 1000 people) & \SetCell[r=3]{} Used as proxies for the strength of the health system. \\ \cline{1-1}
Hospital beds (per 1000 people) &
\\ \cline{1-1}
Nurses and midwives (per 1000 people) & \\
\hline
Critical Fatality Rate & The Critical Fatality Rate (CFR) is the ratio between the total number of cases and the total number of deaths from a determined illness, which in this case is COVID-19. This is a measure of the pandemic’s impact. \\
\hline
\end{tblr}
\caption{Table detailing all control variables and the purpose for including them}
\label{table:1}
\end{table}
\end{document}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | samcarter_is_at_topanswers.xyz |

