2

This question already has an answer here:

I have this table, and I can't fit it, I've tried using adjustbox and resize but it wouldn't fit all of it in a page. Please help!

\begin{table}[h]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{@{}llllll@{}}
\toprule
\multicolumn{3}{l}{\multirow{2}{*}{}}                                      &      \multicolumn{3}{l}{Graph Size} \\ \cmidrule(l){4-6} 
\multicolumn{3}{l}{}                                                       &      50       & 100      & 150      \\ \midrule
\multirow{24}{*}{T = 5}  & \multirow{6}{*}{Lambda = 0}   & Model 1 Alpha   &               &          &          \\ \cmidrule(l){3-6} 
                           &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 1}   & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 10}  & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 100} & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \midrule
 \multirow{24}{*}{T = 10} & \multirow{6}{*}{Lambda = 0}   & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 1}   & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 10}  & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 100} & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \midrule
  \multirow{24}{*}{T = 15} & \multirow{6}{*}{Lambda = 0}   & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 1}   & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 10}  & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 100} & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \bottomrule
\end{tabular}
 \end{table}    

marked as duplicate by Werner tables Jan 9 at 23:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

You have to redesign your table. Right now, you are repeating a lot of stuff. If this is really the final layout of your tabular, you could just do:

% arara: pdflatex

\documentclass{article}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{caption}
\usepackage{rotating}
\usepackage{siunitx}

\begin{document}
    \begin{sidewaystable}
        \centering
        \caption{My caption}
        \label{tab:my-label}
        \begin{tabular}{*{3}{l}S[table-format=2.0]*{2}{S[table-format=3.0]}lS[table-format=2.0]*{2}{S[table-format=3.0]}lS[table-format=2.0]*{2}{S[table-format=3.0]}}
            \toprule
                                          &                 & \multirow{2}{*}{$T = 5$} & \multicolumn{3}{l}{Graph Size} & \multirow{2}{*}{$T = 10$} & \multicolumn{3}{l}{Graph Size} & \multirow{2}{*}{$T = 15$} & \multicolumn{3}{l}{Graph Size} \\ 
            \cmidrule(lr){4-6} \cmidrule(lr){8-10} \cmidrule(l){12-14}
                                          &                 &          & 50       & 100 & 150 & & 50 & 100 & 150 & & 50 & 100 & 150 \\ 
            \midrule
            \multirow{6}{*}{Lambda = 0}   & Model 1 Alpha   &          &          &&&&&&&&&&          \\  
                                          & Model 2 Alpha   &          &          &&&&&&&&&&          \\  
                                          & Model 3 Alpha   &          &          &&&&&&&&&&          \\  
                                          & Model 1 Initial &          &          &&&&&&&&&&          \\ 
                                          & Model 2 Initial &          &          &&&&&&&&&&          \\ 
                                          & Model 3 Initial &          &          &&&&&&&&&&          \\ 
            \midrule 
            \multirow{6}{*}{Lambda = 1}   & Model 1 Alpha   &          &          &&&&&&&&&&          \\ 
                                          & Model 2 Alpha   &          &          &&&&&&&&&&          \\ 
                                          & Model 3 Alpha   &          &          &&&&&&&&&&          \\ 
                                          & Model 1 Initial &          &          &&&&&&&&&&          \\ 
                                          & Model 2 Initial &          &          &&&&&&&&&&          \\ 
                                          & Model 3 Initial &          &          &&&&&&&&&&          \\ 
            \midrule 
            \multirow{6}{*}{Lambda = 10}  & Model 1 Alpha   &          &          &&&&&&&&&&          \\ 
                                          & Model 2 Alpha   &          &          &&&&&&&&&&          \\ 
                                          & Model 3 Alpha   &          &          &&&&&&&&&&          \\ 
                                          & Model 1 Initial &          &          &&&&&&&&&&          \\ 
                                          & Model 2 Initial &          &          &&&&&&&&&&          \\ 
                                          & Model 3 Initial &          &          &&&&&&&&&&          \\ 
            \midrule 
            \multirow{6}{*}{Lambda = 100} & Model 1 Alpha   &          &          &&&&&&&&&&          \\
                                          & Model 2 Alpha   &          &          &&&&&&&&&&          \\
                                          & Model 3 Alpha   &          &          &&&&&&&&&&          \\ 
                                          & Model 1 Initial &          &          &&&&&&&&&&          \\
                                          & Model 2 Initial &          &          &&&&&&&&&&          \\
                                          & Model 3 Initial &          &          &&&&&&&&&&          \\
            \bottomrule
        \end{tabular}
    \end{sidewaystable}    
\end{document}

or something similar.

enter image description here

  • 1
    I would put T over graph size and Lambda in column header. Of course, that is matter of taste. At least, now one can read the content of table! – Zarko Aug 25 '15 at 7:59
  • @Zarko Yes, and I would put "Model" in the header as well. But I fear, this is not the real content of the final table. Too repetitive in the OP. About the T: The table is already too heigh in my MWE. But acceptable IMO. If you load showframe you can see this blemish. – LaRiFaRi Aug 25 '15 at 9:03
2

Building on @LaRiFaRi's observation that it's possible (and highly advisable) to remove a lot of repeated material, here's an even farther reaching reorganization of your table. It can be displayed in portrait mode.

enter image description here

\documentclass{article}
\usepackage{booktabs,caption}

\begin{document}
\begin{table}
\centering
\caption{My caption} \label{tab:my-label}
\begin{tabular}{@{} ll *{9}{c} @{}}
    \toprule
    Lambda & Model &  \multicolumn{9}{c@{}}{$T$}\\
    \cmidrule(l){3-11}
    && \multicolumn{3}{c}{5} 
     & \multicolumn{3}{c}{10} 
     & \multicolumn{3}{c@{}}{15} \\
    \addlinespace
    && \multicolumn{3}{c}{Graph Size} 
     & \multicolumn{3}{c}{Graph Size} 
     & \multicolumn{3}{c@{}}{Graph Size} \\
    \cmidrule(lr){3-5} \cmidrule(lr){6-8} \cmidrule(l){9-11}
    &&  50 & 100 & 150 & 50 & 100 & 150 & 50 & 100 & 150 \\
    \midrule
    0 & 1 Alpha    &&&&&&&&& \\
      & 2 Alpha    &&&&&&&&& \\
      & 3 Alpha    &&&&&&&&& \\
      & 1 Initial  &&&&&&&&& \\
      & 2 Initial  &&&&&&&&& \\
      & 3 Initial  &&&&&&&&& \\
    \midrule
    1 & 1 Alpha    &&&&&&&&& \\
      & 2 Alpha    &&&&&&&&& \\
      & 3 Alpha    &&&&&&&&& \\
      & 1 Initial  &&&&&&&&& \\
      & 2 Initial  &&&&&&&&& \\
      & 3 Initial  &&&&&&&&& \\
    \midrule
    10 & 1 Alpha    &&&&&&&&& \\
       & 2 Alpha    &&&&&&&&& \\
       & 3 Alpha    &&&&&&&&& \\
       & 1 Initial  &&&&&&&&& \\
       & 2 Initial  &&&&&&&&& \\
       & 3 Initial  &&&&&&&&& \\
    \midrule
    100 & 1 Alpha    &&&&&&&&& \\
        & 2 Alpha    &&&&&&&&& \\
        & 3 Alpha    &&&&&&&&& \\
        & 1 Initial  &&&&&&&&& \\
        & 2 Initial  &&&&&&&&& \\
        & 3 Initial  &&&&&&&&& \\
    \bottomrule
\end{tabular}
\end{table}
\end{document} 
0

You can get that by minimizing margins and font size, here we use \tiny.

\documentclass{article}%
\usepackage[margin=5mm]{geometry}
\usepackage{booktabs}
\usepackage{multirow}
\renewcommand{\arraystretch}{0.8}
\begin{document}%
\begin{table}[h]
\centering\tiny
\caption{My caption}
\label{my-label}
\begin{tabular}{@{}llllll@{}}
\toprule
\multicolumn{3}{l}{\multirow{2}{*}{}}                                      &      \multicolumn{3}{l}{Graph Size} \\ \cmidrule(l){4-6} 
\multicolumn{3}{l}{}                                                       &      50       & 100      & 150      \\ \midrule
\multirow{24}{*}{T = 5}  & \multirow{6}{*}{Lambda = 0}   & Model 1 Alpha   &               &          &          \\ \cmidrule(l){3-6} 
                           &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 1}   & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 10}  & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 100} & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \midrule
 \multirow{24}{*}{T = 10} & \multirow{6}{*}{Lambda = 0}   & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 1}   & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 10}  & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 100} & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \midrule
  \multirow{24}{*}{T = 15} & \multirow{6}{*}{Lambda = 0}   & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 1}   & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 10}  & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \cmidrule(l){2-6} 
                     & \multirow{6}{*}{Lambda = 100} & Model 1 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Alpha   &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 1 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 2 Initial &          &          &          \\ \cmidrule(l){3-6} 
                     &                               & Model 3 Initial &          &          &          \\ \bottomrule
\end{tabular}
 \end{table}    
\end{document}%

Output

enter image description here

  • 1
    Who can read this? If real table is similar narrow, then is better split it onto three parts and set them parallel each to other. Or use longtable and spread it over more pages. – Zarko Aug 25 '15 at 6:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.