나는 비머에 테이블을 작성했습니다. 코드는 아래와 같습니다:
\documentclass{beamer}
\usepackage{adjustbox}
\begin{document}
\begin{frame}
\centering
\adjustbox{max height=\dimexpr\textheight-5.5cm\relax,
max width=.9\textwidth}{
\begin{tabular}{|c|c|c|c|c|}
\hline
\begin{tabular}{c}
XYZ\\ABC
\end{tabular}
& \multicolumn{2}{c|}{Number of Vehicles } & \begin{tabular}{c}
Monthly\\Saving
\end{tabular} &
\begin{tabular}{c}
Improvement in\\ ABC (\%)
\end{tabular} \\
\hline
& PQR & ZXC & & \\
\hline
140 & 61 & 41 & 4 & 12 \\
\hline
150 & 83 & 61 & 4 & 12 \\
\hline
170 & 124 & 12 & 4 & 12 \\
\hline
\end{tabular}
}
\end{frame}
\end{document}
항목 4가 한 번만 표시되도록 4번째 열의 마지막 세 행을 병합하고 싶습니다. 어떻게 할 수 있습니까?
답변1
오히려 다음 \hline
을 사용할 수 있습니다\cline{1-3}\cline{5-5}
\documentclass{beamer}
\usepackage{adjustbox}
\begin{document}
\begin{frame}
\centering
\adjustbox{max height=\dimexpr\textheight-5.5cm\relax,
max width=.9\textwidth}{
\begin{tabular}{|c|c|c|c|c|}
\hline
\begin{tabular}{c}
XYZ\\ABC
\end{tabular} &
\multicolumn{2}{c|}{Number of Vehicles } &
\begin{tabular}{c}
Monthly\\Saving
\end{tabular} &
\begin{tabular}{c}
Improvement in\\ ABC (\%)
\end{tabular} \\
\hline
& PQR & ZXC & & \\
\hline
140 & 61 & 41 & & 12 \\
\cline{1-3}\cline{5-5}
150 & 83 & 61 & 4 & 12 \\
\cline{1-3}\cline{5-5}
170 & 124 & 12 & & 12 \\
\hline
\end{tabular}
}
\end{frame}
\end{document}