0

Table column width too far apart. The first column in the table is taking up too much space on the page. Any help would be appreciated

\begin{table}[htbp]
\renewcommand{\arraystretch}{1.5}
  \centering
\caption{Table 1)}
 \begin{adjustbox}{width=1.3\textwidth,center=\textwidth}
\begin{tabular}{rrrr}
\toprule
\textbf{Dependent variable: Y} &       &       &  \\
\hline
\midrule
\multicolumn{1}{c}{}& \multicolumn{1}{c}{\textbf{1}} & \multicolumn{1}{c}{\textbf{2}} & \multicolumn{1}{c}{\textbf{3}} \\
\hline
\multicolumn{1}{l}{A} & \multicolumn{1}{c}{-3.5685***} & \multicolumn{1}{c}{-15.4852***} & \multicolumn{1}{c}{-18.9664***} \\
\multicolumn{1}{l}{} & \multicolumn{1}{c}{(0.000)} & \multicolumn{1}{c}{(0.000)} & \multicolumn{1}{c}{(0.000)} \\
\multicolumn{1}{l}{B} & \multicolumn{1}{c}{-0.03} & \multicolumn{1}{c}{-0.2269} & \multicolumn{1}{c}{-0.0297} \\
\multicolumn{1}{l}{} & \multicolumn{1}{c}{(0.521)} & \multicolumn{1}{c}{(0.387)} & \multicolumn{1}{c}{(0.719)} \\
\multicolumn{1}{l}{C} & \multicolumn{1}{c}{-0.2425***} & \multicolumn{1}{c}{-0.0543} & \multicolumn{1}{c}{-0.101} \\
\multicolumn{1}{l}{} & \multicolumn{1}{c}{(0.000)} & \multicolumn{1}{c}{(0.807)} & \multicolumn{1}{c}{(0.276)} \\
\multicolumn{1}{l}{D} & \multicolumn{1}{c}{0.0404} & \multicolumn{1}{c}{0.2300**} & \multicolumn{1}{c}{-0.2082} \\
\multicolumn{1}{l}{} & \multicolumn{1}{c}{(0.663)} & \multicolumn{1}{c}{(0.028)} & \multicolumn{1}{c}{(0.308)} \\
\multicolumn{1}{l}{E} & \multicolumn{1}{c}{0.6449***} & \multicolumn{1}{c}{0.308} & \multicolumn{1}{c}{0.478} \\
\multicolumn{1}{l}{} & \multicolumn{1}{c}{(0.003)} & \multicolumn{1}{c}{(0.457)} & \multicolumn{1}{c}{(0.141)} \\
\multicolumn{1}{l}{F} & \multicolumn{1}{c}{0} & \multicolumn{1}{c}{0} & \multicolumn{1}{c}{0.0000**} \\
\multicolumn{1}{l}{} & \multicolumn{1}{c}{(0.540)} & \multicolumn{1}{c}{(0.197)} & \multicolumn{1}{c}{(0.012)} \\
\multicolumn{1}{l}{G} & \multicolumn{1}{c}{0} & \multicolumn{1}{c}{-0.0005*} & \multicolumn{1}{c}{0} \\
\multicolumn{1}{l}{} & \multicolumn{1}{c}{(0.746)} & \multicolumn{1}{c}{(0.081)} & \multicolumn{1}{c}{(0.963)} \\
\multicolumn{1}{l}{H} & \multicolumn{1}{c}{0.1527} & \multicolumn{1}{c}{-0.0431} & \multicolumn{1}{c}{-0.1837} \\
\multicolumn{1}{l}{} & \multicolumn{1}{c}{(0.247)} & \multicolumn{1}{c}{(0.901)} & \multicolumn{1}{c}{(0.443)} \\
\multicolumn{1}{l}{I} & \multicolumn{1}{c}{36.4518} & \multicolumn{1}{c}{-103.7022} & \multicolumn{1}{c}{39.1401} \\
\multicolumn{1}{l}{} & \multicolumn{1}{c}{(0.282)} & \multicolumn{1}{c}{(0.191)} & \multicolumn{1}{c}{(0.415)} \\
\multicolumn{1}{l}{J} & \multicolumn{1}{c}{-2.0652} & \multicolumn{1}{c}{6.268} & \multicolumn{1}{c}{-2.2654} \\
\multicolumn{1}{l}{} & \multicolumn{1}{c}{(0.287)} & \multicolumn{1}{c}{(0.175)} & \multicolumn{1}{c}{(0.412)} \\
\multicolumn{1}{l}{K} & \multicolumn{1}{c}{0.002} & \multicolumn{1}{c}{-0.0066} & \multicolumn{1}{c}{0.0023} \\
\multicolumn{1}{l}{} & \multicolumn{1}{c}{(0.278)} & \multicolumn{1}{c}{(0.148)} & \multicolumn{1}{c}{(0.393)} \\
\hline
\multicolumn{1}{c}{\textbf{Number of observations}} & \multicolumn{3}{c}{\textbf{1154}} \\
\hline
\multicolumn{3}{l}{\multirow{\textbf{* p\textless0.1; ** p\textless0.05; *** p\textless0.01}}} & \multicolumn{1}{c}{} \\
\multicolumn{3}{l}{}  & \multicolumn{1}{l}{} \\
\bottomrule
\end{tabular}%
\label{tab:addlabel}%
\end{adjustbox}
\end{table}%
  • 1
    Welcome to TeX.se. Your question will get more (and better) answers if you turn this into a minimal working example by including everything (documentclass through end{document}) and removing whichever lines of the table you don't need. Also, isn't \multicolumn{1} redundant? – Teepeemm Apr 9 '17 at 0:44
  • 2
    Why do you need the adjustbox environment? Also must the no of observations (1154) be in a specific column? – Bernard Apr 9 '17 at 0:58
  • 1
    Can you reduce your code to a minimal working example (MWE), i.e., make it a document and remove as much as possible: rows of the table, \multirow, caption, environments, rules, ... – Elmar Peise Apr 9 '17 at 1:13
  • 2
    The \adjustbox tells LaTeX to make it 130% as wide as there is room for, so it obviously isn't going to fit. Rather than attempting to use auto-generated code for your table, which is always incredibly unreadable and very difficult to adapt and maintain, you would be better off creating the table yourself from scratch as you'll have much simpler code to work with. (The table isn't especially complex - it is just cluttered with a load of stuff not doing anything.) – cfr Apr 9 '17 at 2:49
  • Related/duplicate: My table doesn't fit; what are my options? – Werner Apr 9 '17 at 6:07
4

It is very convenient to use a tool and convert stuff to LaTeX code nobody can read. No, it is not. A simple table like that should have simple code.

My suggestion:

raqTabular

\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}
    \centering
    \caption{Dependency on the variable Y. No Wombats can be found in this table.}
    \medbreak
    \label{tab:addlabel}%
    \begin{tabular}{crrr}
        \toprule
        Y        &            &             & \\
        \midrule
                 & 1          & 2           & 3 \\
        A        & -3.5685*** & -15.4852*** & -18.9664*** \\
                 & (0.000)    & (0.000)     & (0.000) \\\addlinespace
        B        & -0.03      & -0.2269     & -0.0297 \\
                 & (0.521)    & (0.387)     & (0.719) \\\addlinespace
        C        & -0.2425*** & -0.0543     & -0.101 \\
                 & (0.000)    & (0.807)     & (0.276) \\\addlinespace
        D        & 0.0404     & 0.2300**    & -0.2082 \\
                 & (0.663)    & (0.028)     & (0.308) \\\addlinespace
        E        & 0.6449***  & 0.308       & 0.478 \\
                 & (0.003)    & (0.457)     & (0.141) \\\addlinespace
        F        & 0          & 0           & 0.0000** \\
                 & (0.540)    & (0.197)     & (0.012) \\\addlinespace
        G        & 0          & -0.0005*    & 0 \\
                 & (0.746)    & (0.081)     & (0.963) \\\addlinespace
        H        & 0.1527     & -0.0431     & -0.1837 \\
                 & (0.247)    & (0.901)     & (0.443) \\\addlinespace
        I        & 36.4518    & -103.7022   & 39.1401 \\
                 & (0.282)    & (0.191)     & (0.415) \\\addlinespace
        J        & -2.0652    & 6.268       & -2.2654 \\
                 & (0.287)    & (0.175)     & (0.412) \\\addlinespace
        K        & 0.002      & -0.0066     & 0.0023 \\
                 & (0.278)    & (0.148)     & (0.393) \\
        \bottomrule\addlinespace
    \end{tabular}%
    \par
    Number of observations: 1154 \par
    * $p<0.1$; ** $p<.05$; *** $p<.01$
\end{table}%
\end{document}
2

The code you've posted is absolutely horrific. Who on earth taught you to program like this?! Are you using some kind of conversion-to-LaTeX tool? If so, stop using it immediately! It does far more harm than good.

As @Johannes_B's did in his answer, I had to begin by removing all \multicolumn wrappers. I also got rid of all \textbf highlighting -- it simply isn't needed. (Irony intended.) I then deleted all\hline directives (why are they even there, given that you appear to be using the booktabs package) and employed the siunitx package and its S column type to align the numeric data on the respective decimal markers.

Incidentally, why do you show 4 digits after the decimal marker for the coefficient estimates and only 3 for the associated standard errors? What possible meaning can be conveyed by showing 4 digits rather than just 3 for the coefficients? Is this a self-taught habit or did somebody teach you this rather questionable practice?

enter image description here

\documentclass{article}
\usepackage{booktabs,siunitx}
\usepackage[skip=0.333\baselineskip]{caption}
\begin{document}

\begin{table}[htbp]
\sisetup{table-format=-1.4,
         input-symbols={()},
         table-space-text-post={***}}

\caption{A fairly simple table} \label{tab:addlabel}
\centering
Dependent variable: $Y$

\begin{tabular}{@{} lSSS @{}}
\toprule
& {1} & {2} & {3} \\
\midrule
A & -3.5685*** & -15.4852*** & -18.9664*** \\
 & (0.000) & (0.000) & (0.000) \\
B & -0.03 & -0.2269 & -0.0297 \\
 & (0.521) & (0.387) & (0.719) \\
C & -0.2425*** & -0.0543 & -0.101 \\
 & (0.000) & (0.807) & (0.276) \\
D & 0.0404 & 0.2300** & -0.2082 \\
 & (0.663) & (0.028) & (0.308) \\
E & 0.6449*** & 0.308 & 0.478 \\
 & (0.003) & (0.457) & (0.141) \\
F & 0 & 0 & 0.0000** \\
 & (0.540) & (0.197) & (0.012) \\
G & 0 & -0.0005* & 0 \\
 & (0.746) & (0.081) & (0.963) \\
H & 0.1527 & -0.0431 & -0.1837 \\
 & (0.247) & (0.901) & (0.443) \\
I & 36.4518 & -103.7022 & 39.1401 \\
 & (0.282) & (0.191) & (0.415) \\
J & -2.0652 & 6.268 & -2.2654 \\
 & (0.287) & (0.175) & (0.412) \\
K & 0.002 & -0.0066 & 0.0023 \\
 & (0.278) & (0.148) & (0.393) \\
\midrule
No.\ of obs. & {1154} \\ 
\addlinespace
\multicolumn{4}{@{}l}{* $p<0.1$; ** $p<0.05$; *** $p<0.01$} \\
\bottomrule
\end{tabular}
\end{table}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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