为什么“健康”列和“总计”列之间缺少一行?
\begin{table}[ht]
\begin{center}
\begin{tabular}{|c|cc|c|}
\hline
&\multicolumn{2}{c}{BMI} \\
\multirow{-2.5}{*}{\makecell{Activity level}}& {Unhealthy} & {Healthy} &
\multirow{-2.5}{*}{\makecell{Total}} \\
\hline
Inactive & 25 & 21 & 46\\
Active & 9 & 45 & 54\\
\hline
Total &34 & 56 & \textbf{100}\\
\hline
\end{tabular}
\caption{\label{tab:table-name}Data on activity level, resting heart rate
and BMI}
\label{conting2}
\end{center}
\end{table}
答案1
尽管输出与图片不匹配,但您可以用类似这样的内容替换标题部分,这样就为我提供了一个包含所有行的表格:
Activity level &\multicolumn{2}{c|}{BMI} & Total\\
& {Unhealthy} & {Healthy} & \\
编辑:根据 leandriis 进行调整