複数行のため表の境界線が表示されない

複数行のため表の境界線が表示されない

下記の表の適切な境界線を取得するにはどうすればいいでしょうか。コードを参照してください。 ここに画像の説明を入力してください

\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。アンパサンドが抜けています。結果として縦線が抜けています。

    注意: 各行には列の数に応じてアンパサンドが1つ少なくなければなりません。

  • 前文では各パッケージを1つだけリードするだけで十分です

  • テーブルが不必要に複雑になり、テーブルの外観が象徴的になります。例:
    • 列タイプが から に変更され{|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が、1つを除いて、\theadテーブル本体と列ヘッダーのすべての を削除できます。
    • multirow1行のテキストを含むすべてのセルを削除すると、高さが等しくなります。
  • 上記の提案を考慮すると、テーブルコードははるかに短く、クリーンで簡潔になります

修正された表は次のとおりです。

\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} 

ここに画像の説明を入力してください

関連情報