如何关闭表格的行

如何关闭表格的行

我创建了一张表格,但在表格的最后一行,末尾无法关闭...有什么建议吗?

在此处输入图片描述

\begin{table}[H]
\begin{center}
\begin{tabular}{|M{4cm}|M{4cm}|M{4cm}|}
\hline
\textbf{Causal Mechanism} & \textbf{Time Period (1979-1992)} & 
\textbf{Time Period (1992-2014)} \\
\hline
Oil Wealth & Low & High\\
\hline
Foreign aid-dependence & High & High\\
\hline
Challenges from domestic opposition & Low & High\\
\hline
Outcome & \multicolumn{2}{l}{\textbf{Early} ratification of both IWRIs} \\

\hline
\end{tabular}
\end{center}
\end{table}

答案1

使用\multicolumn会覆盖由列数覆盖的每一列的格式。因此,您必须使用(重新)添加完成垂直规则:

在此处输入图片描述

\documentclass{article}

\usepackage{array}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}

\begin{document}

\begin{table}
  \centering
  \begin{tabular}{|M{4cm}|M{4cm}|M{4cm}|}
    \hline
    \textbf{Causal Mechanism} & \textbf{Time Period (1979-1992)} & 
      \textbf{Time Period (1992-2014)} \\
    \hline
    Oil Wealth & Low & High \\
    \hline
    Foreign aid-dependence & High & High \\
    \hline
    Challenges from domestic opposition & Low & High \\
    \hline
    Outcome & \multicolumn{2}{l|}{\textbf{Early} ratification of both IWRIs} \\
    \hline
  \end{tabular}
\end{table}

\end{document}

答案2

您正在使用\multicolumn{2}{l}{....}重写为\multicolumn{2}{l|}{...}

相关内容