表格单元格垂直线丢失

表格单元格垂直线丢失

我使用单元格合并的单元格末尾的垂直线丢失了。

在此处输入图片描述

答案1

这不是您举的例子的唯一问题。

请注意以下示例:

在此处输入图片描述

\documentclass{article}

\usepackage{multirow}

\begin{document}

multirow and multicolumn without brackets (brackets doesn't change much in this case, but they should be there)

\begin{center}
\begin{tabular}{|c|c|c|}
\hline  & \multicolumn{2}{c}.\\
\hline A & B & C \\
\hline D & \multirow{2}{*}E & F \\
\hline & G &\\
\hline
\end{tabular}
\end{center}

... border added

\begin{center}
\begin{tabular}{|c|c|c|}
\hline  & \multicolumn{2}{c|}{.}\\
\hline A & B & C \\
\hline D & \multirow{2}{*}{E} & F \\
\hline & G &\\
\hline
\end{tabular}
\end{center}

multiple borders added (no effect if matching)

\begin{center}
\begin{tabular}{|c|c|c|}
\hline  & \multicolumn{2}{|c|}{.}\\
\hline A & B & C \\
\hline D & \multirow{2}{*}{E} & F \\
\hline & G &\\
\hline
\end{tabular}
\end{center}

multiple borders added (affected if not matching)

\begin{center}
\begin{tabular}{|c|c|c|}
\hline  & \multicolumn{2}{||c|}{.}\\
\hline A & B & C \\
\hline D & \multirow{2}{*}{E} & F \\
\hline & G &\\
\hline
\end{tabular}
\end{center}

multirow changed

\begin{center}
\begin{tabular}{|c|c|c|}
\hline  & \multicolumn{2}{c|}{.}\\
\hline A & B & C \\
\hline \multirow{2}{*}{D} & E & \multirow{2}{*}{F} \\
\hline & G &\\
\hline
\end{tabular}
\end{center}

line fixed

\begin{center}
\begin{tabular}{|c|c|c|}
\hline  & \multicolumn{2}{c|}{.}\\
\hline A & B & C \\
\hline \multirow{2}{*}{D} & E & \multirow{2}{*}{F} \\
\cline{2-2} & G &\\
\hline
\end{tabular}
\end{center}

alignm to top

\begin{center}
\begin{tabular}{|c|c|c|}
\hline  & \multicolumn{2}{c|}{.}\\
\hline A & B & C \\
\hline D & E & F \\
\cline{2-2}
 & G &\\
\hline
\end{tabular}
\end{center}

\end{document}

相关内容