我有一个问题{tabular}
> \newcolumntype{R}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
> \begin{tabular}{|R{2cm}|R{2cm}|R{2cm}|R{2cm}|R{2cm}|}
> \hline
> 1.845 & 0 & 0.61 & & \\ \hline
> 1.885 & 4 & 3.04 & & \\ \hline
> 1.925 & 7 & 9.75 & 11 & 12.79 \\ \hline
> 1.965 & 17 & 2.08 & 17 & 20.08 \\ \hline
> 2.005 & 34 & 26.50 & 34 & 26.50 \\ \hline
> 2.045 & 17 & 22.44 & 17 & 22.44 \\ \hline
> 2.085 & 17 & 12.18 & 17 & 12.18 \\ \hline
> 2.125 & 3 & 4.24 & 4 & 5.18 \\ \hline
> 2.165 & 1 & 0.945 & & \\ \hline \end{tabular}
这就是结果
我怎样才能将用红色突出显示的单元格合并到单行单元格中?
答案1
类似这样的事?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{array, multirow}
\newcolumntype{R}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\begin{document}
\begin{tabular}{|R{2cm}|R{2cm}|R{2cm}|R{2cm}|R{2cm}|}
\hline
1.845 & 0 & 0.61 &\multirow{3}{*}{11} & \multirow{3}{*}{12.79}\\
\cline{1-3}
1.885 & 4 & 3.04 & & \\
\cline{1-3}
1.925 & 7 & 9.75 & & \\
\hline
1.965 & 17 & 2.08 & 17 & 20.08 \\ \hline
2.005 & 34 & 26.50 & 34 & 26.50 \\ \hline
2.045 & 17 & 22.44 & 17 & 22.44 \\ \hline
2.085 & 17 & 12.18 & 17 & 12.18 \\ \hline
2.125 & 3 & 4.24 & \multirow{2}{*}{4} & \multirow{2}{*}{5.18} \\
\cline{1-3}
2.165 & 1 & 0.945 & & \\
\hline
\end{tabular}
\end{document}