3

I would like to split the table on two pages after the model VAR(2) for the Variable A,D. I tried to fix it with the syntax \begin{longtable}...\end{longtable}, but i was not able to solve this problem. enter image description here

Here is the Code for it:

\begin{document}
\begin{landscape}

\begin{table}[htbp]
  \centering
  \caption{Add caption}
    \begin{tabular}{c|clSllllll}
    \toprule
    \multicolumn{1}{c}{\multirow{2}[2]{*}{Variable}} & \multirow{2}[2]{*}{Model} & \multicolumn{2}{c}{\multirow{2}[2]{*}{Estimated Parameters}} & \multicolumn{6}{c}{\multirow{2}[2]{*}{Details}} \\
    \multicolumn{1}{c}{} &       & \multicolumn{2}{c}{} & \multicolumn{6}{c}{} \\
    \midrule
          &       &       &       &       &       &       &       &       &  \\
    \multirow{5}[0]{*}{A} & \multirow{5}[0]{*}{AR(5)} & diff At-1  & 0.052 & \multicolumn{6}{l}{\multirow{5}[0]{*}{AR(5) in diff A with lag order 5, p determined by BIC}} \\
          &       & diff At-2  & 0.158 & \multicolumn{6}{l}{} \\
          &       & diff At-3  & 0.117 & \multicolumn{6}{l}{} \\
          &       & diff At-4  & 0.135 & \multicolumn{6}{l}{} \\
          &       & diff At-5  & 0.262 & \multicolumn{6}{l}{} \\
          &       &       &       &       &       &       &       &       &  \\
    \multirow{2}[0]{*}{A,B} & \multirow{2}[0]{*}{VAR(1)} & diff At-1 & 0.239 & \multicolumn{6}{l}{\multirow{2}[0]{*}{VAR(1) in diff A and diff B with lag order 1 determined by BIC}} \\
          &       & diff Bt-1 & 0.003 & \multicolumn{6}{l}{} \\
          &       &       &       &       &       &       &       &       &  \\
    \multirow{4}[0]{*}{A,C} & \multirow{4}[0]{*}{VAR(2)} & diff At-1 & 0.140 & \multicolumn{6}{l}{\multirow{4}[0]{*}{VAR(2) in diff A and diff C with lag order 2 determined by BIC}} \\
          &       & diff Ct-1 & 0.005 & \multicolumn{6}{l}{} \\
          &       & diff At-2 & 0.280 & \multicolumn{6}{l}{} \\
          &       & diff C2t-2 & 0.004 & \multicolumn{6}{l}{} \\
          &       &       &       &       &       &       &       &       &  \\
    \multirow{3}[0]{*}{A,B,C} & \multirow{3}[0]{*}{VAR(1)} & diff At-1 & 0.239 & \multicolumn{6}{l}{\multirow{3}[0]{*}{VAR(1) in diff A, diff B and diff C with lag order 1 determined by BIC}} \\
          &       & diff Bt-1 & 0.003 & \multicolumn{6}{l}{} \\
          &       & diff Ct-1 & 0.002 & \multicolumn{6}{l}{} \\
          &       &       &       &       &       &       &       &       &  \\
    \multirow{4}[0]{*}{A,D} & \multirow{4}[0]{*}{VAR(2)} & diff At-1 & 0.167 & \multicolumn{6}{l}{\multirow{4}[0]{*}{VAR(2) in diff A and diff D with lag order 2 determined by BIC}} \\
          &       & diff Dt-1 & 0.041 & \multicolumn{6}{l}{} \\
          &       & diff At-2 & 0.276 & \multicolumn{6}{l}{} \\
          &       & diff Dt-2 & 0.026 & \multicolumn{6}{l}{} \\
          &       &       &       &       &       &       &       &       &  \\
    \multirow{6}[0]{*}{A,E} & \multirow{6}[0]{*}{VAR(3)} & diff At-1 & 0.094 & \multicolumn{6}{l}{\multirow{6}[0]{*}{VAR(3) in diff A and diff E with lag order 3 determined by BIC}} \\
          &       & diff Et-1 & -0.009 & \multicolumn{6}{l}{} \\
          &       & diff At-2 & 0.246 & \multicolumn{6}{l}{} \\
          &       & diff Et-2 & -0.136 & \multicolumn{6}{l}{} \\
          &       & diff At-3 & 0.220 & \multicolumn{6}{l}{} \\
          &       & diff Et-3 & 0.145 & \multicolumn{6}{l}{} \\
          &       &       &       &       &       &       &       &       &  \\
    \multirow{4}[1]{*}{A,F} & \multirow{4}[1]{*}{VAR(2)} & diff At-1 & 0.151 & \multicolumn{6}{l}{\multirow{4}[1]{*}{VAR(2) in diff A and diff F with lag oder 2 determined by BIC}} \\
          &       & diff Ft-1 & -0.163 & \multicolumn{6}{l}{} \\
          &       & diff At-2 & 0.291 & \multicolumn{6}{l}{} \\
          &       & diff Ft-2 & 0.082 & \multicolumn{6}{l}{} \\
    \bottomrule
    \end{tabular}%
  \label{tab:addlabel}%
\end{table}%

\end{landscape}
\end{document}



1 Answer 1

3

Here is my suggestion using the longtable package. I have also removed some unnecessary columns (Why all the \multicolumn{6} commands and a total of 10 columns if you actually just need 5?) and replaced empty rows withe the \addlinespace command from booktabs. I have also removed the vertical lines as the booktabs rules, that you already used, are incompatible with vertical lines. I have also added an appropriate table-format option to the S type column to improve the spacing there.

Lastly, I personally would not use vertically centered contents, but I have not changed that in your table.

enter image description here

\documentclass{article}
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{makecell}

\begin{document}
\begin{landscape}
\begin{longtable}{cclS[table-format=-1.3]l}
    \caption{Add caption} \label{tab:addlabel}\\
    \toprule
    \multicolumn{1}{c}{Variable} &Model & \multicolumn{2}{c}{\makecell[cc]{Estimated \\ Parameters}} & Details \\
    \midrule
    \endfirsthead
        \caption{Add caption - continued}\\
    \toprule
    \multicolumn{1}{c}{Variable} &Model & \multicolumn{2}{c}{\makecell[cc]{Estimated \\ Parameters}} & Details \\
    \midrule
    \endhead
    \multirow{5}[0]{*}{A} & \multirow{5}[0]{*}{AR(5)} & diff At-1  & 0.052 & \multirow{5}[0]{*}{AR(5) in diff A with lag order 5, p determined by BIC} \\*
          &       & diff At-2  & 0.158 &  \\*
          &       & diff At-3  & 0.117 &  \\*
          &       & diff At-4  & 0.135 &  \\*
          &       & diff At-5  & 0.262 &  \\ \addlinespace
    \multirow{2}[0]{*}{A,B} & \multirow{2}[0]{*}{VAR(1)} & diff At-1 & 0.239 & \multirow{2}[0]{*}{VAR(1) in diff A and diff B with lag order 1 determined by BIC} \\*
          &       & diff Bt-1 & 0.003 &   \\ \addlinespace
    \multirow{4}[0]{*}{A,C} & \multirow{4}[0]{*}{VAR(2)} & diff At-1 & 0.140 & \multirow{4}[0]{*}{VAR(2) in diff A and diff C with lag order 2 determined by BIC} \\*
          &       & diff Ct-1 & 0.005 &    \\*
          &       & diff At-2 & 0.280 &    \\*
          &       & diff C2t-2 & 0.004 &    \\ \addlinespace
    \multirow{3}[0]{*}{A,B,C} & \multirow{3}[0]{*}{VAR(1)} & diff At-1 & 0.239 & \multirow{3}[0]{*}{VAR(1) in diff A, diff B and diff C with lag order 1 determined by BIC} \\*
          &       & diff Bt-1 & 0.003 &    \\*
          &       & diff Ct-1 & 0.002 &    \\ \addlinespace
    \multirow{4}[0]{*}{A,D} & \multirow{4}[0]{*}{VAR(2)} & diff At-1 & 0.167 & \multirow{4}[0]{*}{VAR(2) in diff A and diff D with lag order 2 determined by BIC} \\*
          &       & diff Dt-1 & 0.041 &    \\*
          &       & diff At-2 & 0.276 &    \\*
          &       & diff Dt-2 & 0.026 &    \\ \addlinespace
    \multirow{6}[0]{*}{A,E} & \multirow{6}[0]{*}{VAR(3)} & diff At-1 & 0.094 & \multirow{6}[0]{*}{VAR(3) in diff A and diff E with lag order 3 determined by BIC} \\*
          &       & diff Et-1 & -0.009 &    \\*
          &       & diff At-2 & 0.246 &    \\*
          &       & diff Et-2 & -0.136 &    \\*
          &       & diff At-3 & 0.220 &    \\*
          &       & diff Et-3 & 0.145 &    \\ \addlinespace
    \multirow{4}[1]{*}{A,F} & \multirow{4}[1]{*}{VAR(2)} & diff At-1 & 0.151 & \multirow{4}[1]{*}{VAR(2) in diff A and diff F with lag oder 2 determined by BIC} \\*
          &       & diff Ft-1 & -0.163 &    \\*
          &       & diff At-2 & 0.291 &    \\*
          &       & diff Ft-2 & 0.082 &    \\*
    \bottomrule
    \end{longtable}%
  %

\end{landscape}
\end{document}

Here is also a suggestion on how you can fit your table onto portrait pages:

enter image description here

\documentclass{article}
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{makecell}

\usepackage{xltabular}
\begin{document}
\begin{xltabular}{\textwidth}{cclS[table-format=1.3]X}
    \caption{Add caption} \label{tab:addlabel}\\
    \toprule
    \multicolumn{1}{c}{Variable} &Model & \multicolumn{2}{c}{\makecell[cc]{Estimated \\ Parameters}} & Details \\
    \midrule
    \endfirsthead
        \caption{Add caption - continued}\\
    \toprule
    \multicolumn{1}{c}{Variable} &Model & \multicolumn{2}{c}{\makecell[cc]{Estimated \\ Parameters}} & Details \\
    \midrule
    \endhead
    A & AR(5) & diff At-1  & 0.052 & \multirow[t]{5}[0]{=}{AR(5) in diff A with lag order 5, p determined by BIC} \\*
          &       & diff At-2  & 0.158 &  \\*
          &       & diff At-3  & 0.117 &  \\*
          &       & diff At-4  & 0.135 &  \\*
          &       & diff At-5  & 0.262 &  \\ \addlinespace
    A,B & VAR(1) & diff At-1 & 0.239 & \multirow[t]{2}[0]{=}{VAR(1) in diff A and diff B with lag order 1 determined by BIC} \\*
          &       & diff Bt-1 & 0.003 &   \\ \addlinespace
\end{xltabular}

\end{document}
1
  • that's perfect. thank you so much!
    – tibiooo
    Jul 23, 2019 at 12:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .