![多行带删除线吗?](https://linux22.com/image/289611/%E5%A4%9A%E8%A1%8C%E5%B8%A6%E5%88%A0%E9%99%A4%E7%BA%BF%E5%90%97%EF%BC%9F.png)
有人可以提示我一下,为什么它\multirow
不能正常工作?
\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{tabular}{c|c|c|c|c|c|}
\emph{step} & 0 & 1 & 2 & 3 & 4 \\ \hline
1. step & & & &3 & \\ \hline \hline
\multirow{2}{*}{2nd step} & 6 & & 2 &3 & \\ \hline
& & & &8 & \\ \hline \hline
\end{tabular}
\end{document}
答案1
\hline
不知道多行,请\cline
改用:
\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{tabular}{c|c|c|c|c|c|}
\emph{step} & 0 & 1 & 2 & 3 & 4 \\ \hline
1. step & & & &3 & \\ \hline \hline
\multirow{2}{*}{2nd step} & 6 & & 2 &3 & \\ \cline{2-6}
& & & &8 & \\ \hline \hline
\end{tabular}
\end{document}
答案2
您需要删除两个单元格之间的水平线,使用\cline{2-6}
而不是\hline
。
\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{tabular}{c|c|c|c|c|c|}
\emph{step} & 0 & 1 & 2 & 3 & 4 \\ \hline
1. step & & & &3 & \\ \hline \hline
\multirow{2}{*}{2nd step} & 6 & & 2 &3 & \\ \cline{2-6}
& & & &8 & \\ \hline \hline
\end{tabular}
\end{document}
不过,我建议去掉垂直线和multirow
包装:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{lcccccc} \toprule
& 0 & 1 & 2 & 3 & 4 \\ \midrule[\heavyrulewidth]
\bfseries 1st step
& & & & 3 & \\ \midrule
\bfseries 2nd step
& 6 & & 2 & 3 & \\ \cmidrule{2-6}
& & & & 8 & \\ \bottomrule
\end{tabular}
\end{document}