由於多行而導致表格邊框遺失

由於多行而導致表格邊框遺失

請問我怎樣才能獲得如下所示表格的正確表格邊框。請看我的程式碼 在此輸入影像描述

\documentclass[journal]{IEEEtran}
\usepackage{multirow}
\usepackage{array}
\usepackage{tabu} 
\usepackage{multicol,graphicx}
\usepackage{makecell}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>
{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\begin{document}
\begin{table*}
\renewcommand{\arraystretch}{1.3}
\caption{Extreme Learning Machine(ELM) with kernel classifier having reduced dimension of feature vectors individual accuracy}
\begin{tabular}{|l|l|C{0.5cm}|L{2cm}|l|l|l|l|} \hline
Algorithm & Dimension &  \multirow{ 6}{*}{\rotatebox{90}{\thead{ADD THESE\\ DIMENSIONS}}}   & Total after Adding Dimensions &Classifier &\multirow{1}{*}{\thead{ Dimension\\Reduction Technique}}             &\multirow{1}{*}{\thead{ Reduced\\Dimension}}&Accuracy \\ \cline{1-2} \cline{4-8} 
CDF & 4D & & &ELM & \multirow{5}{*}{\thead{Correlation as Dimension\\ Estimator, PCA as \\ Dimension Reduction}} &\multirow{5}{*}{\thead{26 dimensions \\ reduced to\\ 4 dimensions}} &\multirow{5}{*}{\thead{Combine accuracy\\ of 4\\ dimensional reduced\\ Feature Vector\\ is 68\%}} \\ \cline{1-2} \cline{5-5}\cline{5-5}
GO & 4D & &\multirow{3}{*}{\thead{4D + 4D + 4D \\ + 7D + 7D= 26D}} &ELM\\ \cline{1-2} \cline{5-5}
Bilateral & 4D & & &ELM \\ \cline{1-2} \cline{5-5}
SLDFFO & 7D & &  &ELM\\ \cline{1-2} \cline{5-5}
SSGSM & 7D & &  &ELM\\ \hline
\end{tabular}
\end{table*}
\end{document}

答案1

  • 錯過的垂直線與使用無關multirow。缺少 & 符號。後果就是缺少垂直線。

    請注意,每一行都必須少一個與號,列數也是如此

  • 每個包中只有一個序言就足夠了

  • 你的桌子不必要的複雜,會導致桌子的外觀一致。例如:
    • {|l|l|C{0.5cm}|L{2cm}|l|l|l|l|}隨著列類型從到 的更改{|l|l|c|C{2.5cm}|c |C{2.5cm}|C{2cm}|C{2.5cm}|} 以及利用最新multirow軟體包的功能,除了一個之外,所有\theads 都可以在表主體以及列標題中刪除
    • 刪除multirow包含一行文字的所有儲存格後,高度相等
  • 考慮到上面的建議表程式碼變得更短、乾淨和簡潔

修改後的表格為:

\documentclass[journal]{IEEEtran}
%\usepackage{array} % loaded twice
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{rotating}% added, for rothead
\usepackage{array, makecell, multirow, tabu}%merged in one line
%\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} % not used
%\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}% in this table is better use this definition

\begin{document}
    \begin{table*}
\settowidth\rotheadsize{DIMENSIONS}
\renewcommand\multirowsetup{\centering}
\renewcommand{\arraystretch}{1.5}
    \centering
\caption{Extreme Learning Machine(ELM) with kernel classifier having reduced dimension of feature vectors individual accuracy}
    \begin{tabular}{|l|l|c|C{2.5cm}|c|C{2.5cm}|C{2cm}|C{2.5cm}|}
    \hline
Algorithm
    & Dimension
        &  \multirow{6}{*}{\rothead{ADD THESE\\ DIMENSIONS}}
            & Total after Adding Dimensions
                & Classifier
                    & Dimension Reduction Technique
                        & Reduced Dimension
                            & Accuracy  \\
    \cline{1-2} \cline{4-8}
CDF & 4D    &
                & \multirow{5}{=}{4D + 4D + 4D\\ + 7D + 7D = 26D}
                    & ELM
                        & \multirow{5}{=}{Correlation as Dimension Estimator,
                                          PCA as Dimension Reduction}
                            & \multirow{5}{=}{26 dimensions reduced to 4 dimensions}
                                & \multirow{5}{=}{Combine accuracy of 4 dimensional
                                                  reduced Feature Vector is 68\%}    \\
    \cline{1-2} \cline{5-5}
GO          & 4D    &   &   & ELM   &   &   &   \\
    \cline{1-2} \cline{5-5}
Bilateral   & 4D    &   &   & ELM   &   &   &   \\
    \cline{1-2} \cline{5-5}
SLDFFO      & 7D    &   &   & ELM   &   &   &   \\
    \cline{1-2} \cline{5-5}
SSGSM       & 7D    &   &   & ELM   &   &   &   \\
    \hline
\end{tabular}
\end{table*}
\end{document}

在此輸入影像描述

答案2

&您只需將s 添加到行的末尾即可。我藉此機會簡化和改進了您的程式碼:

\documentclass[journal]{IEEEtran}
\usepackage{multirow}
\usepackage{array}
\usepackage{tabu}
\usepackage{multicol, graphicx, rotating}
\usepackage{makecell, threeparttable, caption}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\begin{document}

\begin{table*}
\renewcommand{\arraystretch}{1.3}
\settowidth{\rotheadsize}{DIMENSIONS}
\begin{threeparttable}
\caption{Extreme Learning Machine(ELM) with kernel classifier having reduced dimension of feature vectors individual accuracy}
\begin{tabular}{|l|l|C{0.5cm}|L{2cm}|l|l|l|l|} \hline
Algorithm & Dimension &
\multirow{7.5}{*}{\rothead{ADD THESE\\ DIMENSIONS}}
& Total after Adding Dimensions &Classifier &\thead{Dimension\\Reduction Technique} & \thead{ Reduced\\Dimension} & Accuracy \\ \cline{1-2} \cline{4-8}
CDF & 4D & & &ELM & \multirowthead{3.8}{\thead{Correlation as Dimension\\ Estimator, PCA as \\ Dimension Reduction}} & \multirowthead{6}{26 dimensions \\ reduced to\\ 4 dimensions} & \multirowthead{6}{\{Combine accuracy\\ of 4 dimensional reduced \\Feature Vector is 68\,\%} \\ %
\cline{1-2} \cline{5-5}\cline{5-5}
GO & 4D & & \multirowthead{3}{4D + 4D + 4D \\ + 7D + 7D= 26D} & ELM & & & \\ %
\cline{1-2} \cline{5-5}
Bilateral & 4D & & &ELM & & & \\ %
\cline{1-2} \cline{5-5}
SLDFFO & 7D & & &ELM & & & \\ %
\cline{1-2} \cline{5-5}
SSGSM & 7D & & &ELM & & & \\ \hline
\end{tabular}
\end{threeparttable}
\end{table*}

\end{document} 

在此輸入影像描述

相關內容