0

i was working on a table which is rotated by 90 degrees. I don't know what i might have deleted, and I don't get an output anymore. I have an extra } to put somewhere, but wherever I put it, it does not produce my table.. could you please take a look? thank a lot in advance

\begin{table}[H]
\centering
\scalebox{0.7}{%
\begin{adjustbox}{angle=90}
\begin{tabular}{ccccccccccccc}
\hline
Variabla & \multicolumn{4}{c}{2003} & \multicolumn{4}{c}{2008}& \multicolumn{4}{c}{2012} \\
\hline
  $X_{it}$  &  Ln shitje  &  Ln paga  & Ln kapital  &  Ln aktive  & Ln shitje  &   Ln paga  & Ln kapital & Ln aktive & Ln shitje  &  Ln paga &  Lnkcapital  &  Ln aktive \\
export      &       0.699***&       0.192***&       0.646***&       0.779***&       0.837***&       0.238***&       0.627***&       0.842***&       0.923***&       0.245***&       0.593***&       0.957***\\
R-squared   &       0.463   &       0.047   &       0.390   &       0.429   &       0.512   &       0.120   &       0.373   &       0.4
57   &       0.492   &       0.135   &       0.327   &       0.425   \\
N  &   24909   &   24881  &   24909   &   24903   &   29826   &   29778   &   29826 &   29818   &   27050   &   26995  &   27050  &   27042  \\
 \hline
\end{tabular}%
\caption{}\label{fig:}
\end{adjustbox}
\end{table}
3

Your code misses the closing bracket from the scalebox. Aditionally, you can not that easily put a caption command inside an adjustbox environment (See Resize table and caption). In order to rotate a table and its caption, I would use the sidewaystable environment from the rotating package.

As shown in the following MWE, your table and its caption get rotated, but still are much too wide to fit on the page. Reducing the fontsize might work to fit the table onto the page, but depending on the documentclass, one would need an extremely tiny font.

\documentclass{article}
\usepackage{rotating}
\begin{document}

\begin{sidewaystable}
\centering
\begin{tabular}{ccccccccccccc}
\hline
Variabla & \multicolumn{4}{c}{2003} & \multicolumn{4}{c}{2008}& \multicolumn{4}{c}{2012} \\
\hline
  $X_{it}$  &  Ln shitje  &  Ln paga  & Ln kapital  &  Ln aktive  & Ln shitje  &   Ln paga  & Ln kapital & Ln aktive & Ln shitje  &  Ln paga &  Lnkcapital  &  Ln aktive \\
export      &       0.699***&       0.192***&       0.646***&       0.779***&       0.837***&       0.238***&       0.627***&       0.842***&       0.923***&       0.245***&       0.593***&       0.957***\\
R-squared   &       0.463   &       0.047   &       0.390   &       0.429   &       0.512   &       0.120   &       0.373   &       0.4
57   &       0.492   &       0.135   &       0.327   &       0.425   \\
N  &   24909   &   24881  &   24909   &   24903   &   29826   &   29778   &   29826 &   29818   &   27050   &   26995  &   27050  &   27042  \\
 \hline
\end{tabular}%
\caption{}\label{fig:}
\end{sidewaystable}

\end{document}

You might therefor consider to change the layout of your table to something like the following. In this example, I have split up the long rows in thirds and used horizontal rules from the booktabs package.

\documentclass{article}
\usepackage{booktabs}
\begin{document}

\begin{table}
\centering
\begin{tabular}{lcccc}
\toprule
 & \multicolumn{4}{c}{2003}  \\
\cmidrule{2-5}
  $X_{it}$  &  Ln shitje  &  Ln paga  & Ln kapital  &  Ln aktive  \\
export      &       0.699***&       0.192***&       0.646***&       0.779*** \\
R-squared   &       0.463   &       0.047   &       0.390   &       0.429   \\
N  &   24909   &   24881  &   24909   &   24903  \\
 \midrule
  & \multicolumn{4}{c}{2008} \\
 \cmidrule{2-5}
  $X_{it}$  &  Ln shitje  &  Ln paga  & Ln kapital  &  Ln aktive \\
  export      &   0.837***&       0.238***&       0.627***&       0.842***\\
  R-squared   &    0.512   &       0.120   &       0.373   &       0.4 \\
  N  &   29826   &   29778   &   29826 &   29818   \\
  \midrule
   & \multicolumn{4}{c}{2012} \\
  \cmidrule{2-5}
    $X_{it}$  & Ln shitje  &  Ln paga &  Lnkcapital  &  Ln aktive \\
export      &   0.923***&       0.245***&       0.593***&       0.957***\\
R-squared   &       0.492   &       0.135   &       0.327   &       0.425   \\
N    &   27050   &   26995  &   27050  &   27042  \\
 \bottomrule
\end{tabular}%

\caption{some caption}
\label{fig:}
\end{table}

\end{document}

enter image description here

3

I suggest swapping rows and columns, and using the rules of booktabs to add some vertical padding to the rows:

\documentclass{article}

\usepackage{graphicx}
\usepackage[font=small,labelfont=bf]{caption}

\usepackage{rotating, float, booktabs, multirow}

\begin{document}

\begin{table}[H]
\centering
\begin{tabular}{@{}c@{\hskip 6pt}l*{4}{c}}
\toprule
 & \multicolumn{4}{c}{Variabla}\\
\midrule
 & $X_\mathrm{it}$ & export & R-squared & N\\
\midrule
\multirow{4}{*}{\rotatebox{90}{2003}} & Ln shitje & 0.699*** & 0.463 & 24909 \\
 & Ln paga & 0.192*** & 0.047 & 24881 \\
 & Ln kapital & 0.646*** & 0.390 & 24909 \\
 & Ln aktive & 0.779*** & 0.429 & 24903 \\
 \addlinespace
\multirow{4}{*}{\rotatebox{90}{2008}} & Ln shitje & 0.837*** & 0.512 & 29826 \\
 & Ln paga & 0.238*** & 0.120 & 29778 \\
  & Ln kapital & 0.627*** & 0.373 & 29826 \\
  & Ln aktive & 0.842*** & 0.457 & 29818 \\
 \addlinespace
\multirow{4}{*}{\rotatebox{90}{2012}}
 & Ln shitje & 0.923*** & 0.492 & 27050 \\
 & Ln paga & 0.245*** & 0.135 & 26995 \\
 & Ln kapital & 0.593*** & 0.327 & 27050 \\
 & Ln aktive & 0.957*** & 0.425 & 27042 \\
 \bottomrule
\end{tabular}

\caption{}\label{fig:}%
\end{table}

\end{document} 

enter image description here

2

i would use the packages booktabs, threepartable and siunitx and reorganised table similarly as suggest leandriis in his(her) answer:

enter image description here

\documentclass{article}
\usepackage{rotating}
\usepackage{booktabs, threeparttable}
\usepackage{siunitx}

\begin{document}
    \begin{threeparttable}[htb]
\centering
\begin{tabular}{l*{4}{S[table-format=1.3,
                        table-space-text-post=\tnote{***}]}
                }
    \toprule
            &   \multicolumn{4}{c}{2003}  \\
    \cmidrule{2-5}
$X_{it}$    & {Ln shitje}       & {Ln paga}         & {Ln kapital}      & {Ln aktive}       \\
    \midrule
export      & 0.699\tnote{***}  & 0.192\tnote{***}  & 0.646\tnote{***}  & 0.779\tnote{***}  \\
R-squared   & 0.463             & 0.047             & 0.390             & 0.429             \\
N           & {24909}           & {24881}           & {24909}           & {24903}           \\
    \midrule
            &   \multicolumn{4}{c}{2008} \\
    \cmidrule{2-5}
export      & 0.837\tnote{***}  & 0.238\tnote{***}  & 0.627***          & 0.842***          \\
R-squared   & 0.512             & 0.120             & 0.373             & 0.4               \\
N           & {29826}           & {29778}           & {29826}           & {29818}           \\
  \midrule
            &   \multicolumn{4}{c}{2012} \\
  \cmidrule{2-5}
export      & 0.923\tnote{***}  & 0.245\tnote{***}  & 0.593\tnote{***}  & 0.957\tnote{***}  \\
R-squared   & 0.492             & 0.135             & 0.327             & 0.425             \\
N           & {27050}           & {26995}           & {27050}           & {27042}           \\
 \bottomrule
\end{tabular}%
    \begin{tablenotes}[para]
    \item[***] ???
    \end{tablenotes}
    \caption{some caption}
\label{fig:}
    \end{threeparttable}
\end{document}

Note:

  • threeparttable enable to write table notes below table
  • captions at table are usual on the top of table

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.