행 높이가 동일하지 않습니다.

행 높이가 동일하지 않습니다.

여기에 이미지 설명을 입력하세요

아래 그림과 같은 테이블을 만들었지만 괜찮은지 아닌지 잘 모르겠습니다. 내 말은, 두 행 중 첫 번째 행 뒤에 줄 간격이 나타나는 이유는 무엇입니까? 빨간색으로 표시해 두었어요. 아니면 올바른 행동인가요?? 누구든지 나에게 말해 줄 수 있습니까? 여기에 내 코드를 추가했습니다.

\begin{table}[htbp]
    \centering
    \caption{Summary of the comparison with existing approaches}
    \label{tab:Testing Results} 
    \begin{tabular}{|p{.30 cm}|p{2.2cm}|l|l|l|}
        \hline
         \multicolumn{2}{|p{2.5cm}|} {\diagbox { }{Approach}}&Lizhi [4]&Yuan [9]&Our Approach\\\hline
                      CS1 & Total Paths &6 &10 &3\\  \cline{2-5}
                     & Feasible Paths &6 &3 &3\\  \cline{2-5}
                     & Infeasible Paths &0 &7 &0 \\\hline 
                     CS2 & Total Paths &35 &6 &1\\ \cline{2-5}
                     & Feasible Paths &35 &4 &1\\ \cline{2-5}
                     & Infeasible Paths &0 &2 &0 \\\hline
    \end{tabular}
\end{table}

답변1

줄이 적고 숫자가 정렬된 단순화된 버전의 테이블:

\documentclass{article}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{diagbox}
\usepackage{siunitx}
\begin{document}
\begin{table}[htbp]
  \centering
  \caption{Summary of the comparison with existing approaches}
  \label{tab:Testing Results}
  \begin{tabular}{
    l
    l
    S[table-format=2]
    S[table-format=2]
    S[table-format=1]
  }
    \toprule
    & & \multicolumn{3}{c}{Approach}\\
    \cmidrule{3-5}
    & & {Lizhi [4]}&{Yuan [9]}&{Our approach}\\
    \midrule
    CS1 & Total paths &6 &10 &3\\
        & Feasible paths &6 &3 &3\\
        & Infeasible paths &0 &7 &0 \\
    \addlinespace
    CS2 & Total paths &35 &6 &1\\
        & Feasible paths &35 &4 &1\\
        & Infeasible paths &0 &2 &0 \\
    \bottomrule
  \end{tabular}
\end{table}
\end{document}

결과

추가 참고사항:

  • 참고문헌은 LaTeX로도 수행할 수 있으며 [4]매크로 [9]를 호출하여 대체할 수 있습니다 \cite.

  • 타이틀 케이스를 사용할 이유가 없습니다. 따라서 이 예에서는 표의 항목에 대해 간단한 문장 케이스를 사용합니다.

  • Our approach로 잘릴 수 있습니다 Our.

관련 정보