1

I've tried my best to find a solution to this problem by reading different questions/forums, but I simply cannot figure it out: I have a table (made from tablesgenerator.com) that is too long for one page, and I have tried to implement the longtable package, but it is not working.. Any help is much appreciated!

(This it the original code directly from the generator).

\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{llllll}
Index                                                  &                       &   & Statistic & \textit{df} & Sig.           \\ \hline
\multirow{4}{*}{Perimeter}                             & \multirow{2}{*}{Pre}  & C & 0,966     & 8           & 0,862          \\
                                                       &                       & T & 0,935     & 8           & 0,560          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,931     & 8           & 0,524          \\
                                                       &                       & T & 0,995     & 8           & 1,000          \\ \hline
\multirow{4}{*}{Area}                                  & \multirow{2}{*}{Pre}  & C & 0,898     & 8           & 0,279          \\
                                                       &                       & T & 0,951     & 8           & 0,718          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,951     & 8           & 0,717          \\
                                                       &                       & T & 0,963     & 8           & 0,834          \\ \hline
\multirow{4}{*}{Form Factor}                           & \multirow{2}{*}{Pre}  & C & 0,975     & 8           & 0,934          \\
                                                       &                       & T & 0,940     & 8           & 0,613          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,939     & 8           & 0,606          \\
                                                       &                       & T & 0,699     & 8           & \textbf{0,002} \\ \hline
\multirow{4}{*}{Perimeter - Area Ratio of Convex Hull} & \multirow{2}{*}{Pre}  & C & 0,887     & 8           & 0,222          \\
                                                       &                       & T & 0,852     & 8           & 0,100          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,983     & 8           & 0,978          \\
                                                       &                       & T & 0,962     & 8           & 0,833          \\ \hline
\multirow{4}{*}{Area - Maximum Area Ratio}             & \multirow{2}{*}{Pre}  & C & 0,977     & 8           & 0,948          \\
                                                       &                       & T & 0,965     & 8           & 0,853          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,966     & 8           & 0,865          \\
                                                       &                       & T & 0,931     & 8           & 0,522          \\ \hline
\multirow{4}{*}{Ratio of Radii}                        & \multirow{2}{*}{Pre}  & C & 0,970     & 8           & 0,897          \\
                                                       &                       & T & 0,967     & 8           & 0,877          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,958     & 8           & 0,793          \\
                                                       &                       & T & 0,924     & 8           & 0,465          \\ \hline
\multirow{4}{*}{Global Convex Deficiency}              & \multirow{2}{*}{Pre}  & C & 0,972     & 8           & 0,915          \\
                                                       &                       & T & 0,917     & 8           & 0,404          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,949     & 8           & 0,704          \\
                                                       &                       & T & 0,821     & 8           & \textbf{0,048} \\ \hline
\multirow{4}{*}{Rugosity}                              & \multirow{2}{*}{Pre}  & C & 0,790     & 9           & \textbf{0,023} \\
                                                       &                       & T & 0,888     & 8           & 0,223          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,837     & 8           & 0,070          \\
                                                       &                       & T & 0,682     & 8           & \textbf{0,001} \\ \hline
\multirow{4}{*}{Horizontal Vertices Symmetry}          & \multirow{2}{*}{Pre}  & C & 0,980     & 8           & 0,965          \\
                                                       &                       & T & 0,936     & 8           & 0,572          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,931     & 8           & 0,528          \\
                                                       &                       & T & 0,937     & 8           & 0,586          \\ \hline
\multirow{4}{*}{Vertical Vertices Symmetry}            & \multirow{2}{*}{Pre}  & C & 0,941     & 8           & 0,620          \\
                                                       &                       & T & 0,848     & 8           & 0,092          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,928     & 8           & 0,499          \\
                                                       &                       & T & 0,946     & 8           & 0,675          \\ \hline
\multirow{4}{*}{Left Right Area Symmetry}              & \multirow{2}{*}{Pre}  & C & 0,924     & 8           & 0,466          \\
                                                       &                       & T & 0,844     & 8           & 0,083          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,922     & 8           & 0,448          \\
                                                       &                       & T & 0,925     & 8           & 0,469          \\ \hline
\multirow{4}{*}{Top Bottom Area Symmetry}              & \multirow{2}{*}{Pre}  & C & 0,847     & 8           & 0,090          \\
                                                       &                       & T & 0,834     & 8           & 0,066          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,786     & 8           & \textbf{0,020} \\
                                                       &                       & T & 0,911     & 8           & 0,363          \\ \hline
\multirow{4}{*}{Horizontal Symmetry of Convex Hull}    & \multirow{2}{*}{Pre}  & C & 0,841     & 8           & 0,077          \\
                                                       &                       & T & 0,964     & 8           & 0,847          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,904     & 8           & 0,315          \\
                                                       &                       & T & 0,925     & 8           & 0,473          \\ \hline
\multirow{4}{*}{Vertical Symmetry of Convex Hull}      & \multirow{2}{*}{Pre}  & C & 0,767     & 8           & \textbf{0,012} \\
                                                       &                       & T & 0,950     & 8           & 0,713          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,752     & 8           & \textbf{0,009} \\
                                                       &                       & T & 0,856     & 8           & 0,109          \\ \hline
\multirow{4}{*}{Elongation}                            & \multirow{2}{*}{Pre}  & C & 0,908     & 8           & 0,337          \\
                                                       &                       & T & 0,880     & 8           & 0,187          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,927     & 8           & 0,489          \\
                                                       &                       & T & 0,843     & 8           & 0,081          \\ \hline
\multirow{4}{*}{Regularity}                            & \multirow{2}{*}{Pre}  & C & 0,760     & 8           & \textbf{0,010} \\
                                                       &                       & T & 0,940     & 8           & 0,607          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,948     & 8           & 0,691          \\
                                                       &                       & T & 0,960     & 8           & 0,808          \\ \hline
\end{tabular}
\end{table}
3
  • @koleygr thank you for the edit, I tried doing the MWE format thing, but it obviously didn't work (as you can probably tell I am brand new to Latex).
    – Karen
    Apr 4, 2018 at 10:31
  • OffQustionTopic-OnCommentTopic: You have to paste the code (as you did) and after that, select all of it and press the button {}. Welcome!
    – koleygr
    Apr 4, 2018 at 10:33
  • Hi, welcome. This looks to be quite similar to tex.stackexchange.com/questions/424435/…, does that description help? Apr 4, 2018 at 10:48

1 Answer 1

4

This works for me:

\documentclass{article}
\usepackage{multirow}
\usepackage{longtable}
\begin{document}
\begin{longtable}{llllll}
\caption{My caption}
\label{my-label}\\
Index&&& Statistic & \textit{df} & Sig.\\ \hline
\multirow{4}{*}{Perimeter}                             & \multirow{2}{*}{Pre}  & C & 0,966     & 8           & 0,862          \\
                                                       &                       & T & 0,935     & 8           & 0,560          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,931     & 8           & 0,524          \\
                                                       &                       & T & 0,995     & 8           & 1,000          \\ \hline
\multirow{4}{*}{Area}                                  & \multirow{2}{*}{Pre}  & C & 0,898     & 8           & 0,279          \\
                                                       &                       & T & 0,951     & 8           & 0,718          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,951     & 8           & 0,717          \\
                                                       &                       & T & 0,963     & 8           & 0,834          \\ \hline
\multirow{4}{*}{Form Factor}                           & \multirow{2}{*}{Pre}  & C & 0,975     & 8           & 0,934          \\
                                                       &                       & T & 0,940     & 8           & 0,613          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,939     & 8           & 0,606          \\
                                                       &                       & T & 0,699     & 8           & \textbf{0,002} \\ \hline
\multirow{4}{*}{Perimeter - Area Ratio of Convex Hull} & \multirow{2}{*}{Pre}  & C & 0,887     & 8           & 0,222          \\
                                                       &                       & T & 0,852     & 8           & 0,100          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,983     & 8           & 0,978          \\
                                                       &                       & T & 0,962     & 8           & 0,833          \\ \hline
\multirow{4}{*}{Area - Maximum Area Ratio}             & \multirow{2}{*}{Pre}  & C & 0,977     & 8           & 0,948          \\
                                                       &                       & T & 0,965     & 8           & 0,853          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,966     & 8           & 0,865          \\
                                                       &                       & T & 0,931     & 8           & 0,522          \\ \hline
\multirow{4}{*}{Ratio of Radii}                        & \multirow{2}{*}{Pre}  & C & 0,970     & 8           & 0,897          \\
                                                       &                       & T & 0,967     & 8           & 0,877          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,958     & 8           & 0,793          \\
                                                       &                       & T & 0,924     & 8           & 0,465          \\ \hline
\multirow{4}{*}{Global Convex Deficiency}              & \multirow{2}{*}{Pre}  & C & 0,972     & 8           & 0,915          \\
                                                       &                       & T & 0,917     & 8           & 0,404          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,949     & 8           & 0,704          \\
                                                       &                       & T & 0,821     & 8           & \textbf{0,048} \\ \hline
\multirow{4}{*}{Rugosity}                              & \multirow{2}{*}{Pre}  & C & 0,790     & 9           & \textbf{0,023} \\
                                                       &                       & T & 0,888     & 8           & 0,223          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,837     & 8           & 0,070          \\
                                                       &                       & T & 0,682     & 8           & \textbf{0,001} \\ \hline
\multirow{4}{*}{Horizontal Vertices Symmetry}          & \multirow{2}{*}{Pre}  & C & 0,980     & 8           & 0,965          \\
                                                       &                       & T & 0,936     & 8           & 0,572          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,931     & 8           & 0,528          \\
                                                       &                       & T & 0,937     & 8           & 0,586          \\ \hline
\multirow{4}{*}{Vertical Vertices Symmetry}            & \multirow{2}{*}{Pre}  & C & 0,941     & 8           & 0,620          \\
                                                       &                       & T & 0,848     & 8           & 0,092          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,928     & 8           & 0,499          \\
                                                       &                       & T & 0,946     & 8           & 0,675          \\ \hline
\multirow{4}{*}{Left Right Area Symmetry}              & \multirow{2}{*}{Pre}  & C & 0,924     & 8           & 0,466          \\
                                                       &                       & T & 0,844     & 8           & 0,083          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,922     & 8           & 0,448          \\
                                                       &                       & T & 0,925     & 8           & 0,469          \\ \hline
\multirow{4}{*}{Top Bottom Area Symmetry}              & \multirow{2}{*}{Pre}  & C & 0,847     & 8           & 0,090          \\
                                                       &                       & T & 0,834     & 8           & 0,066          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,786     & 8           & \textbf{0,020} \\
                                                       &                       & T & 0,911     & 8           & 0,363          \\ \hline
\multirow{4}{*}{Horizontal Symmetry of Convex Hull}    & \multirow{2}{*}{Pre}  & C & 0,841     & 8           & 0,077          \\
                                                       &                       & T & 0,964     & 8           & 0,847          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,904     & 8           & 0,315          \\
                                                       &                       & T & 0,925     & 8           & 0,473          \\ \hline
\multirow{4}{*}{Vertical Symmetry of Convex Hull}      & \multirow{2}{*}{Pre}  & C & 0,767     & 8           & \textbf{0,012} \\
                                                       &                       & T & 0,950     & 8           & 0,713          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,752     & 8           & \textbf{0,009} \\
                                                       &                       & T & 0,856     & 8           & 0,109          \\ \hline
\multirow{4}{*}{Elongation}                            & \multirow{2}{*}{Pre}  & C & 0,908     & 8           & 0,337          \\
                                                       &                       & T & 0,880     & 8           & 0,187          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,927     & 8           & 0,489          \\
                                                       &                       & T & 0,843     & 8           & 0,081          \\ \hline
\multirow{4}{*}{Regularity}                            & \multirow{2}{*}{Pre}  & C & 0,760     & 8           & \textbf{0,010} \\
                                                       &                       & T & 0,940     & 8           & 0,607          \\ \cline{2-6} 
                                                       & \multirow{2}{*}{Post} & C & 0,948     & 8           & 0,691          \\
                                                       &                       & T & 0,960     & 8           & 0,808          \\ \hline
\end{longtable}
\end{document}

Just did the below:

1) changed your table environment to longtable

2) removed tabular environment and placed its first argument {llllll} naex to long table

3) finished a line (added a \\) after \caption and \label commands.

PS: Also added the longtable and multirow packages an a simple "article template"

2
  • Thank you so much, it works for me as well! I had apparently misunderstood where to place the \\. Thank you for saving my bachelors report!
    – Karen
    Apr 4, 2018 at 11:07
  • Welcome... You may accept the answer but sometimes followup answers are coming after some time. They may show you how to create better looking tables etc. (If you don't want something like this, because of automating things via programming or whatever, please make it clear for the next possible "answerers" to not try). Also, please try next time to provide a real MWE (tex.meta.stackexchange.com/questions/228/…)... In your case it was just two three more commands... But is good anyway...
    – koleygr
    Apr 4, 2018 at 11:12

You must log in to answer this question.

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