[Tex/LaTex] Fit wide table to landscape page – Legibility

lscapepdflscapetables

I have a wide table to fit in a landscape page. I'm trying a combination of

  1. changing the font size of the header paragraph
  2. changing the font size of the table contents
  3. resizing the table in a resizebox
  4. setting the width of the tabular environment

Is there a better way to do this? What's the best way to fit a table such as this to a page? To date, I've just been using trial and error with \resizebox{1.0\linewidth}{!}{ and \begin{tabular*}{1.6\linewidth}{@{

\documentclass[12pt]{article}
\usepackage{graphics}
\usepackage{booktabs}
\usepackage{dcolumn}
\usepackage{eurosym}
\usepackage{pdflscape}
\usepackage{lscape}
\usepackage{lipsum}

\begin{document}

\begin{landscape}
\begin{table}
\renewcommand{\arraystretch}{1}
\caption{My Caption}
\label{table:ufukFour}
\footnotesize                                   %Option (a) 
\lipsum[1-2]
\begin{center}
\scriptsize                                     %Option (b) 
\resizebox{1.0\linewidth}{!}{                   %Option (c) 
\begin{tabular*}{1.6\linewidth}{@{              %Option (d) 
\global\let\restorecr=\\ 
\extracolsep{\fill} } cc rrrrr rrrrr rrrrr}
\toprule        
%\global\let\oldcr=\\ 
%\global\def\crsng{\global\let\\ =\crtri\oldcr}
%\global\def\crdbl{\global\let\\ =\crsng\oldcr}
%\global\def\crtri{\global\let\\ =\crdbl\oldcr[10pt]}
%\global\let\\=\crtri

\global\let\oldcr=\\ 
\global\def\crsng{\global\let\\ =\crqua\oldcr}
\global\def\crdbl{\global\let\\ =\crsng\oldcr}
\global\def\crtri{\global\let\\ =\crdbl\oldcr}
\global\def\crqua{\global\let\\ =\crtri\oldcr[10pt]}
\global\let\\=\crqua

&&\multicolumn{5}{c}{\textbf{One}}
& \multicolumn{5}{c}{\textbf{Two}}
& \multicolumn{5}{c}{\textbf{Three}} \vspace{-0.3cm}\\

\cmidrule(lr){3-7}
\cmidrule(lr){8-12}
\cmidrule(lr){13-17}

&&\multicolumn{1}{c}{Cat 1} & \multicolumn{1}{c}{Cat 2} & \multicolumn{1}{c}{Cat 3} & \multicolumn{1}{c}{Cat 4} & \multicolumn{1}{c}{Cat 5} 
& \multicolumn{1}{c}{Cat 1} & \multicolumn{1}{c}{Cat 2} & \multicolumn{1}{c}{Cat 3} & \multicolumn{1}{c}{Cat 4} & \multicolumn{1}{c}{Cat 5} 
& \multicolumn{1}{c}{Cat 1} & \multicolumn{1}{c}{Cat 2} & \multicolumn{1}{c}{Cat 3} & \multicolumn{1}{c}{Cat 4} & \multicolumn{1}{c}{Cat 5} \tabularnewline

\cmidrule(lr){3-7}
\cmidrule(lr){8-12}
\cmidrule(lr){13-17}
&&\multicolumn{15}{c}{\textbf{Panel A: First Panel}}\tabularnewline
\cmidrule(lr){3-7}
\cmidrule(lr){8-12}
\cmidrule(lr){13-17}
    ~First    & A     &       47\%     &       34\%     &       21\%     &       21\%     &       18\%     &       40\%     &       31\%     &       25\%     &       19\%     &       18\%     &       26\%     &       24\%     &       19\%     &       14\%     &       12\%    \\
   ~ & B     &       29\%     &       38\%     &       49\%     &       50\%     &       52\%     &       43\%     &       48\%     &       51\%     &       55\%     &       56\%     &       63\%     &       61\%     &       64\%     &       68\%     &       67\%    \\
   ~ & C    &       24\%     &       28\%     &       30\%     &       30\%     &       30\%     &       17\%     &       21\%     &       24\%     &       26\%     &       26\%     &       10\%     &       15\%     &       17\%     &       18\%     &       21\%    \\
   ~ & N    & \textit{11494}    &  \textit{4089}    &  \textit{3239}    &  \textit{1904}    &  \textit{1322}    &  \textit{4801}    &  \textit{2471}    &  \textit{1795}    &  \textit{1438}    &  \textit{1187}    &   \textit{808}    &   \textit{651}    &   \textit{557}    &   \textit{529}    &   \textit{459}   \\
Second    & A     &       25\%     &       18\%     &       14\%     &       11\%     &       10\%     &       18\%     &       13\%     &        9\%     &        8\%     &        8\%     &       14\%     &        8\%     &        6\%     &        5\%     &        4\%    \\
   ~ & B     &       55\%     &       59\%     &       63\%     &       64\%     &       64\%     &       65\%     &       68\%     &       72\%     &       73\%     &       73\%     &       76\%     &       81\%     &       83\%     &       84\%     &       85\%    \\
   ~ & C    &       20\%     &       23\%     &       23\%     &       26\%     &       26\%     &       17\%     &       19\%     &       19\%     &       19\%     &       20\%     &        9\%     &       11\%     &       11\%     &       12\%     &       11\%    \\
   ~ & N    &  \textit{7801}    &  \textit{6363}    &  \textit{4018}    &  \textit{3166}    &  \textit{2643}    &  \textit{6279}    &  \textit{6151}    &  \textit{5336}    &  \textit{5208}    &  \textit{4861}    &  \textit{1707}    &  \textit{2268}    &  \textit{2615}    &  \textit{2905}    &  \textit{3053}   \\

\cmidrule(lr){3-7}
\cmidrule(lr){8-12}
\cmidrule(lr){13-17}
%
&&\multicolumn{15}{c}{\textbf{Panel B: Second Panel}} \tabularnewline
\cmidrule(lr){3-7}
\cmidrule(lr){8-12}
\cmidrule(lr){13-17}
    ~First    & A     &       47\%     &       34\%     &       21\%     &       21\%     &       18\%     &       40\%     &       31\%     &       25\%     &       19\%     &       18\%     &       26\%     &       24\%     &       19\%     &       14\%     &       12\%    \\
   ~ & B     &       29\%     &       38\%     &       49\%     &       50\%     &       52\%     &       43\%     &       48\%     &       51\%     &       55\%     &       56\%     &       63\%     &       61\%     &       64\%     &       68\%     &       67\%    \\
   ~ & C    &       24\%     &       28\%     &       30\%     &       30\%     &       30\%     &       17\%     &       21\%     &       24\%     &       26\%     &       26\%     &       10\%     &       15\%     &       17\%     &       18\%     &       21\%    \\
   ~ & N    & \textit{11494}    &  \textit{4089}    &  \textit{3239}    &  \textit{1904}    &  \textit{1322}    &  \textit{4801}    &  \textit{2471}    &  \textit{1795}    &  \textit{1438}    &  \textit{1187}    &   \textit{808}    &   \textit{651}    &   \textit{557}    &   \textit{529}    &   \textit{459}   \\
Second    & A     &       25\%     &       18\%     &       14\%     &       11\%     &       10\%     &       18\%     &       13\%     &        9\%     &        8\%     &        8\%     &       14\%     &        8\%     &        6\%     &        5\%     &        4\%    \\
   ~ & B     &       55\%     &       59\%     &       63\%     &       64\%     &       64\%     &       65\%     &       68\%     &       72\%     &       73\%     &       73\%     &       76\%     &       81\%     &       83\%     &       84\%     &       85\%    \\
   ~ & C    &       20\%     &       23\%     &       23\%     &       26\%     &       26\%     &       17\%     &       19\%     &       19\%     &       19\%     &       20\%     &        9\%     &       11\%     &       11\%     &       12\%     &       11\%    \\
   ~ & N    &  \textit{7801}    &  \textit{6363}    &  \textit{4018}    &  \textit{3166}    &  \textit{2643}    &  \textit{6279}    &  \textit{6151}    &  \textit{5336}    &  \textit{5208}    &  \textit{4861}    &  \textit{1707}    &  \textit{2268}    &  \textit{2615}    &  \textit{2905}    &  \textit{3053}   \\       
    \cmidrule(lr){3-7}
\cmidrule(lr){8-12}
\cmidrule(lr){13-17}
%
&&\multicolumn{15}{c}{\textbf{Panel C: Third Panel}} \tabularnewline
\cmidrule(lr){3-7}
\cmidrule(lr){8-12}
\cmidrule(lr){13-17}
    ~First    & A     &       47\%     &       34\%     &       21\%     &       21\%     &       18\%     &       40\%     &       31\%     &       25\%     &       19\%     &       18\%     &       26\%     &       24\%     &       19\%     &       14\%     &       12\%    \\
   ~ & B     &       29\%     &       38\%     &       49\%     &       50\%     &       52\%     &       43\%     &       48\%     &       51\%     &       55\%     &       56\%     &       63\%     &       61\%     &       64\%     &       68\%     &       67\%    \\
   ~ & C    &       24\%     &       28\%     &       30\%     &       30\%     &       30\%     &       17\%     &       21\%     &       24\%     &       26\%     &       26\%     &       10\%     &       15\%     &       17\%     &       18\%     &       21\%    \\
   ~ & N    & \textit{11494}    &  \textit{4089}    &  \textit{3239}    &  \textit{1904}    &  \textit{1322}    &  \textit{4801}    &  \textit{2471}    &  \textit{1795}    &  \textit{1438}    &  \textit{1187}    &   \textit{808}    &   \textit{651}    &   \textit{557}    &   \textit{529}    &   \textit{459}   \\
Second    & A     &       25\%     &       18\%     &       14\%     &       11\%     &       10\%     &       18\%     &       13\%     &        9\%     &        8\%     &        8\%     &       14\%     &        8\%     &        6\%     &        5\%     &        4\%    \\
   ~ & B     &       55\%     &       59\%     &       63\%     &       64\%     &       64\%     &       65\%     &       68\%     &       72\%     &       73\%     &       73\%     &       76\%     &       81\%     &       83\%     &       84\%     &       85\%    \\
   ~ & C    &       20\%     &       23\%     &       23\%     &       26\%     &       26\%     &       17\%     &       19\%     &       19\%     &       19\%     &       20\%     &        9\%     &       11\%     &       11\%     &       12\%     &       11\%    \\
   ~ & N    &  \textit{7801}    &  \textit{6363}    &  \textit{4018}    &  \textit{3166}    &  \textit{2643}    &  \textit{6279}    &  \textit{6151}    &  \textit{5336}    &  \textit{5208}    &  \textit{4861}    &  \textit{1707}    &  \textit{2268}    &  \textit{2615}    &  \textit{2905}    &  \textit{3053}   \\       
\bottomrule
\end{tabular*}
}
\end{center}
\end{table}
\end{landscape}
\end{document}

Best Answer

Assuming a "normal" paper size (i.e., A4 or US-Letter) and 1" margins, the table will fit in landscape mode if you use \footnotesize and set the default amount of intercolumn whitespace to a very small value; by using a tabular* environment and the @{\extracolsep{\fill}} directive, you can tell LaTeX to perform the chore of making the table fit exactly in the width of the text block. (A nice side-effect of this setup, by the way, is that you needn't provide any trimming options to the \cmidrule directives.)

In order to create a bit more of an "open" look, do insert a few \addlinespace instructions here and there.

enter image description here

\documentclass[12pt]{article}
\usepackage{booktabs,dcolumn,eurosym,caption}
\usepackage{rotating} % for 'sidewaystable' environment
\usepackage[margin=1in]{geometry}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % handy shorcut macro

\begin{document}
\begin{sidewaystable}
\renewcommand{\arraystretch}{1}
\caption{My Caption}
\label{table:Four}
\footnotesize
\setlength\tabcolsep{0.1mm} % let LaTeX calculate intercolumn whitespace
\begin{tabular*}{\textwidth}{l @{\extracolsep{\fill}}
      c *{15}{r} }
\toprule        

&&\multicolumn{5}{c}{\textbf{One}}
& \multicolumn{5}{c}{\textbf{Two}}
& \multicolumn{5}{c}{\textbf{Three}} \\

\cmidrule{3-7} \cmidrule{8-12} \cmidrule{13-17}

&&\mc{Cat 1} & \mc{Cat 2} & \mc{Cat 3} & \mc{Cat 4} & \mc{Cat 5} 
& \mc{Cat 1} & \mc{Cat 2} & \mc{Cat 3} & \mc{Cat 4} & \mc{Cat 5} 
& \mc{Cat 1} & \mc{Cat 2} & \mc{Cat 3} & \mc{Cat 4} & \mc{Cat 5} \\

\cmidrule{3-7} \cmidrule{8-12} \cmidrule{13-17}
\addlinespace

&&\multicolumn{15}{c}{\textbf{Panel A: First Panel}}\\
\cmidrule{3-7} \cmidrule{8-12} \cmidrule{13-17}
    First    & A     &       47\%     &       34\%     &       21\%     &       21\%     &       18\%     &       40\%     &       31\%     &       25\%     &       19\%     &       18\%     &       26\%     &       24\%     &       19\%     &       14\%     &       12\%    \\
    & B     &       29\%     &       38\%     &       49\%     &       50\%     &       52\%     &       43\%     &       48\%     &       51\%     &       55\%     &       56\%     &       63\%     &       61\%     &       64\%     &       68\%     &       67\%    \\
    & C    &       24\%     &       28\%     &       30\%     &       30\%     &       30\%     &       17\%     &       21\%     &       24\%     &       26\%     &       26\%     &       10\%     &       15\%     &       17\%     &       18\%     &       21\%    \\
    & N    & \textit{11494}    &  \textit{4089}    &  \textit{3239}    &  \textit{1904}    &  \textit{1322}    &  \textit{4801}    &  \textit{2471}    &  \textit{1795}    &  \textit{1438}    &  \textit{1187}    &   \textit{808}    &   \textit{651}    &   \textit{557}    &   \textit{529}    &   \textit{459}   \\
\addlinespace
Second    & A     &       25\%     &       18\%     &       14\%     &       11\%     &       10\%     &       18\%     &       13\%     &        9\%     &        8\%     &        8\%     &       14\%     &        8\%     &        6\%     &        5\%     &        4\%    \\
    & B     &       55\%     &       59\%     &       63\%     &       64\%     &       64\%     &       65\%     &       68\%     &       72\%     &       73\%     &       73\%     &       76\%     &       81\%     &       83\%     &       84\%     &       85\%    \\
    & C    &       20\%     &       23\%     &       23\%     &       26\%     &       26\%     &       17\%     &       19\%     &       19\%     &       19\%     &       20\%     &        9\%     &       11\%     &       11\%     &       12\%     &       11\%    \\
    & N    &  \textit{7801}    &  \textit{6363}    &  \textit{4018}    &  \textit{3166}    &  \textit{2643}    &  \textit{6279}    &  \textit{6151}    &  \textit{5336}    &  \textit{5208}    &  \textit{4861}    &  \textit{1707}    &  \textit{2268}    &  \textit{2615}    &  \textit{2905}    &  \textit{3053}   \\

\cmidrule{3-7} \cmidrule{8-12} \cmidrule{13-17}
\addlinespace

&&\multicolumn{15}{c}{\textbf{Panel B: Second Panel}} \\
\cmidrule{3-7} \cmidrule{8-12} \cmidrule{13-17}
    First    & A     &       47\%     &       34\%     &       21\%     &       21\%     &       18\%     &       40\%     &       31\%     &       25\%     &       19\%     &       18\%     &       26\%     &       24\%     &       19\%     &       14\%     &       12\%    \\
    & B     &       29\%     &       38\%     &       49\%     &       50\%     &       52\%     &       43\%     &       48\%     &       51\%     &       55\%     &       56\%     &       63\%     &       61\%     &       64\%     &       68\%     &       67\%    \\
    & C    &       24\%     &       28\%     &       30\%     &       30\%     &       30\%     &       17\%     &       21\%     &       24\%     &       26\%     &       26\%     &       10\%     &       15\%     &       17\%     &       18\%     &       21\%    \\
    & N    & \textit{11494}    &  \textit{4089}    &  \textit{3239}    &  \textit{1904}    &  \textit{1322}    &  \textit{4801}    &  \textit{2471}    &  \textit{1795}    &  \textit{1438}    &  \textit{1187}    &   \textit{808}    &   \textit{651}    &   \textit{557}    &   \textit{529}    &   \textit{459}   \\
\addlinespace
Second    & A     &       25\%     &       18\%     &       14\%     &       11\%     &       10\%     &       18\%     &       13\%     &        9\%     &        8\%     &        8\%     &       14\%     &        8\%     &        6\%     &        5\%     &        4\%    \\
    & B     &       55\%     &       59\%     &       63\%     &       64\%     &       64\%     &       65\%     &       68\%     &       72\%     &       73\%     &       73\%     &       76\%     &       81\%     &       83\%     &       84\%     &       85\%    \\
    & C    &       20\%     &       23\%     &       23\%     &       26\%     &       26\%     &       17\%     &       19\%     &       19\%     &       19\%     &       20\%     &        9\%     &       11\%     &       11\%     &       12\%     &       11\%    \\
    & N    &  \textit{7801}    &  \textit{6363}    &  \textit{4018}    &  \textit{3166}    &  \textit{2643}    &  \textit{6279}    &  \textit{6151}    &  \textit{5336}    &  \textit{5208}    &  \textit{4861}    &  \textit{1707}    &  \textit{2268}    &  \textit{2615}    &  \textit{2905}    &  \textit{3053}   \\       
\cmidrule{3-7} \cmidrule{8-12} \cmidrule{13-17}
\addlinespace
&&\multicolumn{15}{c}{\textbf{Panel C: Third Panel}} \tabularnewline
\cmidrule{3-7} \cmidrule{8-12} \cmidrule{13-17}
    First    & A     &       47\%     &       34\%     &       21\%     &       21\%     &       18\%     &       40\%     &       31\%     &       25\%     &       19\%     &       18\%     &       26\%     &       24\%     &       19\%     &       14\%     &       12\%    \\
    & B     &       29\%     &       38\%     &       49\%     &       50\%     &       52\%     &       43\%     &       48\%     &       51\%     &       55\%     &       56\%     &       63\%     &       61\%     &       64\%     &       68\%     &       67\%    \\
    & C    &       24\%     &       28\%     &       30\%     &       30\%     &       30\%     &       17\%     &       21\%     &       24\%     &       26\%     &       26\%     &       10\%     &       15\%     &       17\%     &       18\%     &       21\%    \\
    & N    & \textit{11494}    &  \textit{4089}    &  \textit{3239}    &  \textit{1904}    &  \textit{1322}    &  \textit{4801}    &  \textit{2471}    &  \textit{1795}    &  \textit{1438}    &  \textit{1187}    &   \textit{808}    &   \textit{651}    &   \textit{557}    &   \textit{529}    &   \textit{459}   \\
\addlinespace
Second    & A     &       25\%     &       18\%     &       14\%     &       11\%     &       10\%     &       18\%     &       13\%     &        9\%     &        8\%     &        8\%     &       14\%     &        8\%     &        6\%     &        5\%     &        4\%    \\
    & B     &       55\%     &       59\%     &       63\%     &       64\%     &       64\%     &       65\%     &       68\%     &       72\%     &       73\%     &       73\%     &       76\%     &       81\%     &       83\%     &       84\%     &       85\%    \\
    & C    &       20\%     &       23\%     &       23\%     &       26\%     &       26\%     &       17\%     &       19\%     &       19\%     &       19\%     &       20\%     &        9\%     &       11\%     &       11\%     &       12\%     &       11\%    \\
    & N    &  \textit{7801}    &  \textit{6363}    &  \textit{4018}    &  \textit{3166}    &  \textit{2643}    &  \textit{6279}    &  \textit{6151}    &  \textit{5336}    &  \textit{5208}    &  \textit{4861}    &  \textit{1707}    &  \textit{2268}    &  \textit{2615}    &  \textit{2905}    &  \textit{3053} 
\\
\bottomrule 
\end{tabular*}
\end{sidewaystable}
\end{document}
Related Question