DanishBeef DanishBeef - 4 months ago 7
LaTeX Question

LaTex large table

I'm trying to make a large table fit onto a normal A4 in LaTeX, but the table is too wide and too long to fit onto the page.
Is there any way to either resize or edit the table so that it still looks good?

This is the LaTeX code:

\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{lrrrrrr}
\hline
\multicolumn{1}{r}{1.000 kr.} & Gennemsnit & Median & Maximum & Minimum & Std. Afv. & Obs \\ \hline
\multicolumn{7}{l}{} \\
\multicolumn{7}{l}{\textit{Gruppe 1 - arbejdende kapital over 75 mia. kr.}} \\ \hline \\
LLP & 2.021.677 & 1.020.805 & 21.118.106 & -1.161.518 & 3.757.255 & 55 \\
ASSETS & 677.772.504 & 243.796.860 & 2.678.868.060 & 84.162.315 & 799.425.914 & 55 \\
LLR & 7.412.215 & 3.795.000 & 38.291.000 & 29.000 & 10.139.636 & 55 \\
NPL & 10.886.748 & 3.141.000 & 62.634.000 & 3.000 & 17.167.682 & 55 \\
ΔNPL & 740.568 & 272.500 & 38.934.000 & -21.082.000 & 7.046.437 & 50 \\
LOANS & 274.996.591 & 113.144.318 & 1.120.719.254 & 19.483.778 & 335.501.730 & 55 \\
AUDITFEE & 2.705 & 1.763 & 9.000 & 1.000 & 2.472 & 51 \\
CEO & 8,4 & 7,0 & 27,0 & 1,0 & 7,0 & 55 \\
Tier\_1 ratio & 13,66\% & 13,10\% & 25,10\% & 7,00\% & 4,86\% & 55 \\
\multicolumn{7}{l}{} \\
\multicolumn{7}{l}{\textit{Gruppe 2 - arbejdende kapital over 12 mia. kr.}} \\ \hline \\
LLP & 194.863 & 129.306 & 1.514.755 & -173.648 & 266.366 & 121 \\
ASSETS & 20.061.790 & 13.692.504 & 79.691.370 & 1.947.303 & 17.403.150 & 121 \\
LLR & 682.680 & 465.600 & 3.733.900 & -23.590 & 710.980 & 121 \\
NPL & 1.771.651 & 1.152.917 & 8.494.802 & 19.925 & 1.821.055 & 120 \\
ΔNPL & 171.948 & 135.632 & 2.357.300 & -7.369.011 & 948.672 & 109 \\
LOANS & 12.093.382 & 8.757.828 & 44.153.113 & 1.971.284 & 9.234.746 & 121 \\
AUDITFEE & 836 & 756 & 2.769 & 275 & 1.642 & 121 \\
CEO & 10,4 & 8,0 & 30,0 & 1,0 & 6,9 & 121 \\
Tier\_1 ratio & 14,57\% & 15,20\% & 20,90\% & 5,60\% & 3,82\% & 121 \\
& \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} \\
\multicolumn{7}{l}{\textit{Gruppe 3 - arbejdende kapital over 500 mio. kr.}} \\ \hline
\multicolumn{7}{l}{} \\
LLP & 52.570 & 11.572 & 1.794.700 & -34.671 & 153.635 & 420 \\
ASSETS & 5.112.874 & 2.219.054 & 131.547.004 & 204.893 & 13.932.241 & 421 \\
LLR & 166.170 & 51.431 & 2.424.900 & -9.916 & 336.828 & 386 \\
NPL & 359.430 & 104.147 & 7.797.700 & 700 & 810.633 & 407 \\
ΔNPL & 39.559 & 7.778 & 2.973.200 & -3.330.200 & 333.519 & 365 \\
LOANS & 2.761.302 & 1.318.042 & 66.833.444 & 89.680 & 7.150.800 & 421 \\
AUDITFEE & 475 & 399 & 2.600 & 82 & 302 & 411 \\
CEO & 11,1 & 9,0 & 36,0 & 1,0 & 8,8 & 416 \\
Tier\_1 ratio & 17,67\% & 16,40\% & 86,30\% & 4,10\% & 7,56\% & 418 \\
& \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} \\
\multicolumn{7}{l}{\textit{Gruppe 4 - arbejdende kapital under 500 mio. kr.}} \\ \hline
\multicolumn{7}{l}{} \\
LLP & 1.088 & 332 & 16.274 & -6.521 & 2.359 & 182 \\
ASSETS & 193.815 & 188.888 & 506.999 & 15.074 & 122.881 & 186 \\
LLR & 6.284 & 3.725 & 41.694 & -84 & 7.727 & 183 \\
NPL & 13.401 & 8.887 & 99.212 & 69 & 15.348 & 166 \\
ΔNPL & 1.822 & 500 & 25.455 & -10.545 & 5.636 & 148 \\
LOANS & 111.274 & 102.792 & 287.727 & 3.712 & 77.169 & 186 \\
AUDITFEE & 144 & 121 & 1.584 & 18 & 146 & 185 \\
CEO & 12,0 & 11,0 & 30,0 & 1,0 & 7,6 & 186 \\
Tier\_1 ratio & 23,19\% & 22,60\% & 47,80\% & -0,20\% & 7,85\% & 186
\end{tabular}
\end{table}


I'm very new to LaTeX so if you need anymore information please ask and I'll supply.

The margins for the document is:

\setmarginsrb { 1.5in} % left margin
{ 0.6in} % top margin
{ 1.0in} % right margin
{ 1in} % bottom margin
{ 20pt} % head height
{0.25in} % head sep
{ 9pt} % foot height
{ 0.3in} % foot sep


I'm using the premium version of sharelatex.com

Answer

You can use \resizebox command from graphicx package. See the following code:

\documentclass{article}

\usepackage{blindtext}
\usepackage{graphicx}
\usepackage{vmargin}

\setmarginsrb           { 1.5in}  % left margin
                        { 0.6in}  % top margin
                        { 1.0in}  % right margin
                        { 1in}  % bottom margin
                        {  20pt}  % head height
                        {0.25in}  % head sep
                        {   9pt}  % foot height
                        { 0.3in}  % foot sep
\begin{document}


\begin{table}[t!]
\centering
\caption{My caption}
\label{my-label}
\resizebox{\textwidth}{!}{%
\begin{tabular}{lrrrrrr}
\hline
\multicolumn{1}{r}{1.000 kr.} & Gennemsnit           & Median               & Maximum              & Minimum              & Std. Afv.            & Obs        \\ \hline
\multicolumn{7}{l}{}                                                                                                                                                    \\
\multicolumn{7}{l}{\textit{Gruppe 1 - arbejdende kapital over 75 mia. kr.}}                      \\ \hline                                                                         \\
LLP                           & 2.021.677            & 1.020.805            & 21.118.106           & -1.161.518           & 3.757.255            & 55                   \\
ASSETS                        & 677.772.504          & 243.796.860          & 2.678.868.060        & 84.162.315           & 799.425.914          & 55                   \\
LLR                           & 7.412.215            & 3.795.000            & 38.291.000           & 29.000               & 10.139.636           & 55                   \\
NPL                           & 10.886.748           & 3.141.000            & 62.634.000           & 3.000                & 17.167.682           & 55                   \\
NPL                          & 740.568              & 272.500              & 38.934.000           & -21.082.000          & 7.046.437            & 50                   \\
LOANS                         & 274.996.591          & 113.144.318          & 1.120.719.254        & 19.483.778           & 335.501.730          & 55                   \\
AUDITFEE                      & 2.705                & 1.763                & 9.000                & 1.000                & 2.472                & 51                   \\
CEO                           & 8,4                  & 7,0                  & 27,0                 & 1,0                  & 7,0                  & 55                   \\
Tier\_1 ratio                 & 13,66\%              & 13,10\%              & 25,10\%              & 7,00\%               & 4,86\%               & 55                   \\
\multicolumn{7}{l}{}                                                                                                                                                    \\
\multicolumn{7}{l}{\textit{Gruppe 2 - arbejdende kapital over 12 mia. kr.}}                             \\ \hline                                                                \\
LLP                           & 194.863              & 129.306              & 1.514.755            & -173.648             & 266.366              & 121                  \\
ASSETS                        & 20.061.790           & 13.692.504           & 79.691.370           & 1.947.303            & 17.403.150           & 121                  \\
LLR                           & 682.680              & 465.600              & 3.733.900            & -23.590              & 710.980              & 121                  \\
NPL                           & 1.771.651            & 1.152.917            & 8.494.802            & 19.925               & 1.821.055            & 120                  \\
NPL                          & 171.948              & 135.632              & 2.357.300            & -7.369.011           & 948.672              & 109                  \\
LOANS                         & 12.093.382           & 8.757.828            & 44.153.113           & 1.971.284            & 9.234.746            & 121                  \\
AUDITFEE                      & 836                  & 756                  & 2.769                & 275                  & 1.642                & 121                  \\
CEO                           & 10,4                 & 8,0                  & 30,0                 & 1,0                  & 6,9                  & 121                  \\
Tier\_1 ratio                 & 14,57\%              & 15,20\%              & 20,90\%              & 5,60\%               & 3,82\%               & 121                  \\
                              & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} \\
\multicolumn{7}{l}{\textit{Gruppe 3 - arbejdende kapital over 500 mio. kr.}}                            \\ \hline                                                                
\multicolumn{7}{l}{}                                                                                                                                                    \\
LLP                           & 52.570               & 11.572               & 1.794.700            & -34.671              & 153.635              & 420                  \\
ASSETS                        & 5.112.874            & 2.219.054            & 131.547.004          & 204.893              & 13.932.241           & 421                  \\
LLR                           & 166.170              & 51.431               & 2.424.900            & -9.916               & 336.828              & 386                  \\
NPL                           & 359.430              & 104.147              & 7.797.700            & 700                  & 810.633              & 407                  \\
NPL                          & 39.559               & 7.778                & 2.973.200            & -3.330.200           & 333.519              & 365                  \\
LOANS                         & 2.761.302            & 1.318.042            & 66.833.444           & 89.680               & 7.150.800            & 421                  \\
AUDITFEE                      & 475                  & 399                  & 2.600                & 82                   & 302                  & 411                  \\
CEO                           & 11,1                 & 9,0                  & 36,0                 & 1,0                  & 8,8                  & 416                  \\
Tier\_1 ratio                 & 17,67\%              & 16,40\%              & 86,30\%              & 4,10\%               & 7,56\%               & 418                  \\
                              & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} \\
\multicolumn{7}{l}{\textit{Gruppe 4 - arbejdende kapital under 500 mio. kr.}}                            \\ \hline                                                       
\multicolumn{7}{l}{}                                                                                                                                                    \\
LLP                           & 1.088                & 332                  & 16.274               & -6.521               & 2.359                & 182                  \\
ASSETS                        & 193.815              & 188.888              & 506.999              & 15.074               & 122.881              & 186                  \\
LLR                           & 6.284                & 3.725                & 41.694               & -84                  & 7.727                & 183                  \\
NPL                           & 13.401               & 8.887                & 99.212               & 69                   & 15.348               & 166                  \\
NPL                          & 1.822                & 500                  & 25.455               & -10.545              & 5.636                & 148                  \\
LOANS                         & 111.274              & 102.792              & 287.727              & 3.712                & 77.169               & 186                  \\
AUDITFEE                      & 144                  & 121                  & 1.584                & 18                   & 146                  & 185                  \\
CEO                           & 12,0                 & 11,0                 & 30,0                 & 1,0                  & 7,6                  & 186                  \\
Tier\_1 ratio                 & 23,19\%              & 22,60\%              & 47,80\%              & -0,20\%              & 7,85\%               & 186                 
\end{tabular}}

\end{table}

\blindtext

\end{document}