1

I have the following table in Appendix A. I would like to fit the table into the width of any other regular page. How can I split the long content of specific column rows into 2 rows for fitting and what else can I do it? Here is my Appendix table:

\documentclass{article}
    \usepackage{booktabs,makecell,tabularx}
    \renewcommand\theadfont{\small}
    \newcolumntype{L}{>{\raggedright\arraybackslash}X}
    \usepackage{siunitx}
    \renewcommand{\thetable}{\arabic{table}} 
\begin{document}
    \section{\\Appendix: One-sample t-test 5\% results of ABCD accuracy vs. accuracy of other JKFG HIJK accuracy} \label{App:AppendixA}
    \begin{table}[H]
        \centering
        \begin{tabular}{||c c c c c ||} 
            \hline
            Dataset & No. of SKLH & ABCD Accuracy & Mean of JKFG Accuracy& T-test\\ [0.5ex] 
            \hline\hline
            Cardiotocography & 1 & 0.999 & 0.999 & - \\ 
            \hline
            Cardiotocography &  4 & 0.999 & 0.999 & Not-Rejected \\ 
            \hline
            Cardiotocography &  8 & 0.999 & 0.999 & Reject \\
            \hline
            Cardiotocography & 16 & 0.999 & 0.999 & Not-Rejected \\
            \hline
            Cardiotocography & 32 & 0.999 & 0.999 & Reject \\
            \hline
            Cardiotocography & 64 & N/A & N/A & N/A \\
            \hline 
            Wall-Following Robot Navigation & 1 & 0.999 & 0.999 & - \\
            \hline
            Wall-Following Robot Navigation &   4   & 0.999 & 0.999 & Not-Rejected\\
            \hline
            Wall-Following Robot Navigation &   8   & 0.999 & 0.999 & Not-Rejected\\
            \hline
            Wall-Following Robot Navigation &   16  & 0.999 & 0.999 & Not-Rejected\\
            \hline
            Wall-Following Robot Navigation &   32  & 0.999 & 0.999 & Reject\\
            \hline
            Wall-Following Robot Navigation &   64  & 0.999 & 0.9996 & Not-Rejected\\
            \hline
            Spambase &  1   & 0.999 & 0.999 & -\\
            \hline
            Spambase &  4   & 0.999 & 0.999 & Not-Rejected\\
            \hline
            Spambase &  8   & 0.999 & 0.999 & Not-Rejected\\
            \hline
            Spambase &  16  & 0.999 & 0.999 & Reject\\
            \hline
            Spambase &  32  & 0.999 & 0.999 & Not-Rejected\\
            \hline
            Spambase &  64  & 0.999 & 0.999 & Not-Rejected\\
            \hline
            MAGIC Gamma Telescope & 1   & 0.999 & 0.999 & -\\
            \hline
            MAGIC Gamma Telescope & 4   & 0.999 & 0.999 & Not-Rejected\\
            \hline
            MAGIC Gamma Telescope & 8   & 0.999 & 0.999 & Reject\\
            \hline
            MAGIC Gamma Telescope & 16  & 0.999 & 0.999 & Reject\\
            \hline
            MAGIC Gamma Telescope & 32  & 0.999 & 0.999 & Not-Rejected\\
            \hline
            MAGIC Gamma Telescope & 64  & 0.999 & 0.999 & Not-Rejected\\
            \hline
            Letter Recognition &    1   & 0.999 & 0.999 & -\\
            \hline
            Letter Recognition & 4  & 0.999 & 0.999 & Not-Rejected\\
            \hline
            Letter Recognition & 8  & 0.999 & 0.999 & Not-Rejected\\
            \hline
            Letter Recognition & 16 & 0.999 & 0.999 & Not-Rejected\\
            \hline
            Letter Recognition & 32 & 0.999 & 0.999 & Reject\\
            \hline
            Letter Recognition & 64 & 0.999 & 0.999 & Reject\\
            \hline
            MiniBooNE particle identification & 1   & 0.999 & 0.999 & -\\
            \hline
            MiniBooNE particle identification & 4   & 0.999 & 0.999 & Not-Rejected\\
            \hline
            MiniBooNE particle identification & 8   & 0.999 & 0.999 & Not-Rejected\\
            \hline
            MiniBooNE particle identification & 16  & 0.999 & 0.999 & Reject\\
            \hline
            MiniBooNE particle identification & 32  & 0.999 & 0.999 & Not-Rejected\\
            \hline
            MiniBooNE particle identification & 64  & 0.999 & 0.999 & Not-Rejected\\
            [1ex]\hline 
        \end{tabular}
    \end{table} 

 \end{document}

1 Answer 1

1

See, it his is what you like to obtain:

\documentclass{article}
    \usepackage{booktabs,makecell}%,tabularx
    \renewcommand\theadfont{\small}
%    \newcolumntype{L}{>{\raggedright\arraybackslash}X}
    \usepackage{siunitx}
%    \renewcommand{\thetable}{\arabic{table}}

\begin{document}
    \section{Appendix: One-sample t-test 5\% results of ABCD accuracy vs. accuracy of other JKFG HIJK accuracy} \label{App:AppendixA}
    \begin{table}
        \centering
        \begin{tabular}{ c S[table-format=2.0] 
                            S[table-format=1.3] 
                            S[table-format=1.4] c }
    \toprule
\thead{Dataset} 
    &   {\thead{Number\\ of SKLH}} 
        &   {\thead{ABCD\\ Accuracy}} 
            &   {\thead{Mean of\\ JKFG Accuracy}}
                &   \thead{T-test}                  \\ 
    \midrule
Cardiotocography & 1 & 0.999 & 0.999 & -            \\
Cardiotocography &  4 & 0.999 & 0.999 & Not-Rejected \\
Cardiotocography &  8 & 0.999 & 0.999 & Reject \\
    \addlinespace
Cardiotocography & 16 & 0.999 & 0.999 & Not-Rejected \\
Cardiotocography & 32 & 0.999 & 0.999 & Reject \\
Cardiotocography & 64 & N/A & N/A & N/A \\
    \addlinespace
Wall-Following Robot Navigation & 1 & 0.999 & 0.999 & - \\
Wall-Following Robot Navigation &   4   & 0.999 & 0.999 & Not-Rejected\\
Wall-Following Robot Navigation &   8   & 0.999 & 0.999 & Not-Rejected\\
    \addlinespace
Wall-Following Robot Navigation &   16  & 0.999 & 0.999 & Not-Rejected\\
Wall-Following Robot Navigation &   32  & 0.999 & 0.999 & Reject\\
Wall-Following Robot Navigation &   64  & 0.999 & 0.9996 & Not-Rejected\\
    \addlinespace
Spambase &  1   & 0.999 & 0.999 & -\\
Spambase &  4   & 0.999 & 0.999 & Not-Rejected\\
Spambase &  8   & 0.999 & 0.999 & Not-Rejected\\
    \addlinespace
Spambase &  16  & 0.999 & 0.999 & Reject\\
Spambase &  32  & 0.999 & 0.999 & Not-Rejected\\
Spambase &  64  & 0.999 & 0.999 & Not-Rejected\\
    \addlinespace
MAGIC Gamma Telescope & 1   & 0.999 & 0.999 & -\\
MAGIC Gamma Telescope & 4   & 0.999 & 0.999 & Not-Rejected\\
MAGIC Gamma Telescope & 8   & 0.999 & 0.999 & Reject\\
    \addlinespace
MAGIC Gamma Telescope & 16  & 0.999 & 0.999 & Reject\\
MAGIC Gamma Telescope & 32  & 0.999 & 0.999 & Not-Rejected\\
MAGIC Gamma Telescope & 64  & 0.999 & 0.999 & Not-Rejected\\
    \addlinespace
Letter Recognition &    1   & 0.999 & 0.999 & -\\
Letter Recognition & 4  & 0.999 & 0.999 & Not-Rejected\\
Letter Recognition & 8  & 0.999 & 0.999 & Not-Rejected\\
    \addlinespace
Letter Recognition & 16 & 0.999 & 0.999 & Not-Rejected\\
Letter Recognition & 32 & 0.999 & 0.999 & Reject\\
Letter Recognition & 64 & 0.999 & 0.999 & Reject\\
    \addlinespace
MiniBooNE particle identification & 1   & 0.999 & 0.999 & -\\
MiniBooNE particle identification & 4   & 0.999 & 0.999 & Not-Rejected\\
MiniBooNE particle identification & 8   & 0.999 & 0.999 & Not-Rejected\\
    \addlinespace
MiniBooNE particle identification & 16  & 0.999 & 0.999 & Reject\\
MiniBooNE particle identification & 32  & 0.999 & 0.999 & Not-Rejected\\
MiniBooNE particle identification & 64  & 0.999 & 0.999 & Not-Rejected\\
    \bottomrule
    \end{tabular}
\end{table}
    \end{document}

The commented lines in preamble are only not necessary for this table, however they are not harm. The table is to "tall" that it can be placed on the same page with section title (actually, this is valid for default article layout).

As you see, i break three column headers into two lines and make with this table narrower. Also I exploit presence of booktabs package and redesign the table appearance.

Snipped of table looks:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .