表格分隔线不对齐

表格分隔线不对齐

我创建了一个包含 3 列的表格:

\begin{table}[htbp]
    \begin{tabular}{ p{6cm} || >{\centering\arraybackslash} p{3cm} || >{\centering\arraybackslash} p{3cm} }     
\hline
 \text Dummy & Dummy & Dummy \\
 \hline \\
  \text Dummy & Dummy & Dummy \\
  \text Dummy & Dummy & Dummy \\
  \text Dummy & Dummy & Dummy \\
  \text Dummy & Dummy & Dummy \\
  \text Dummy & Dummy & Dummy \\
  \text Dummy & Dummy & Dummy \\
  \text Dummy & Dummy & Dummy \\
  \text Dummy & Dummy & Dummy \\ \\
  \hline
 \end{tabular} 
 \caption{Dummy}
 \label{fig:CAMean}
\end{table}

结果是这样的: 虚拟表

我不明白为什么第二条垂直线跳过了一些部分?

答案1

有一些“改进”

\documentclass{article}

\usepackage{booktabs}
\usepackage{array}

\newcommand{\text}{}


\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}

\begin{document}

\begin{table}[htbp]
    \begin{tabular}{ p{6cm} ||C{3cm} ||C{3cm}}
\hline
 \text Dummy & Dummy & Dummy \\
 \hline  & & \\
  \text Dummy & Dummy & Dummy \\
  \text Dummy & Dummy & Dummy \\
  \text Dummy & Dummy & Dummy \\
  \text Dummy & Dummy & Dummy \\
  \text Dummy & Dummy & Dummy \\
  \text Dummy & Dummy & Dummy \\
  \text Dummy & Dummy & Dummy \\
  \text Dummy & Dummy & Dummy \\ 
  & & \\
  \hline
 \end{tabular} 
 \caption{Dummy}
 \label{fig:CAMean}


\begin{center}
\begin{tabular}{ p{6cm} ||C{3cm} ||C{3cm}}
\toprule
 \text Dummy & Dummy & Dummy \tabularnewline
 \midrule  & & \tabularnewline
  \text Dummy & Dummy & Dummy \tabularnewline
  \text Dummy & Dummy & Dummy \tabularnewline
  \text Dummy & Dummy & Dummy \tabularnewline
  \text Dummy & Dummy & Dummy \tabularnewline
  \text Dummy & Dummy & Dummy \tabularnewline
  \text Dummy & Dummy & Dummy \tabularnewline
  \text Dummy & Dummy & Dummy \tabularnewline
  \text Dummy & Dummy & Dummy \tabularnewline 
  & & \tabularnewline
  \bottomrule
 \end{tabular} 
 \caption{Dummy}
 \label{fig:CAMeanother}
\end{center}
\end{table}

\end{document

在此处输入图片描述

相关内容