How to create a table in landscape environment with multi column

1,415

Solution 1

Here is a start for you.

With \usepackage{rotating und sidewasytable and not landscape.

enter image description here

\documentclass[a4paper]{article}

\usepackage{pdflscape,array,booktabs}
\setlength\tabcolsep{5pt}

\usepackage{rotating}
\begin{document}

\begin{sidewaystable}
\caption{Simulation results}
\begin{tabular}{>{\raggedright}p{2.2cm}lcccccccccccc}
\hline
 & \multicolumn{2}{c}{Settings} & \multicolumn{10}{c}{Analysis}       \\
 \cline{2-3} \cline{5-13}
 Model & $\beta$          & n       &   & PERFECT & CC & NO-T & LOGT & T & T2 & NA & COX & COX*\\
 \midrule
\multicolumn{13}{l}{Bias}                                \\
 Base case*&     0        &   336    &    & 0.00 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 \\
&    0        &   336  &       & 0.00 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 \\
&    0        &   336  &       & 0.00 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 \\
Shape 2&    0        &   336  &       & 0.00 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 \\
Admin cens 2&    0        &   336  &       & 0.00 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 \\\multicolumn{13}{l}{}   \\ 

\multicolumn{13}{l}{Per cent error in model standard error}                                \\
 Base case&     0        &   336    &    & 0.00 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 \\
&    0        &   336  &       & 0.00 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 \\
&    0        &   336  &       & 0.00 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 \\
Shape 2&    0        &   336  &       & 0.00 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 \\
Admin cens 2&    0        &   336  &       & 0.00 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 \\
\multicolumn{13}{l}{}   \\ 

\multicolumn{13}{l}{Power}                                \\
 Base case&     0        &   336    &    & 0.00 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 \\
&    0        &   336  &       & 0.00 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 \\
Shape 2&    0        &   336  &       & 0.00 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 \\
admin cens&    0        &   336  &       & 0.00 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 & -0.01 \\
\bottomrule
\multicolumn{13}{l}{*Base case: ...}                                \\
\end{tabular}

\end{sidewaystable}

\end{document}

Ref. used: https://tex.stackexchange.com/a/133436/124842

Solution 2

Wanted to learn this myself, so I made a try.

preview

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{array}
\usepackage{rotating}
\begin{document}

\begin{sidewaystable}
\begin{tabular}{lm{1.4cm}m{1.4cm}m{1.4cm}m{1.4cm}m{1.4cm}m{1.4cm}m{1.4cm}m{1.4cm}m{1.4cm}m{1.4cm}m{1.4cm}m{1.4cm}}
\multicolumn{12}{c}{Table III. Simulation results for parameter I\} in univariate model with binary X.} \\ \hline
& \multicolumn{2}{c}{Settings} & \multicolumn{9}{c}{Analyses} \\ \cline{2-3} \cline{8-8}
 &  &  &  &  &  &  &  &  &  &  &  \\
Model & Beta & n & PERFECT & CC & NO-T & LOGT & T & T2 & NA & COX & COX* \\ \hline
Bias &  &  &  &  &  &  &  &  &  &  &  \\
Base case* & 0 & 336 & 0 & -0,01 & -0,01 & -0,01 & -0,01 & -0,01 & -0,01 & -0,01 & -0,01 \\
 &  &  &  &  &  &  &  &  &  &  &  \\
 & 0,5 & 336 & 0 & 0 & -0,26 & -0,06 & 0 & -0,02 & 0 & 0 & 0 \\
 &  &  &  &  &  &  &  &  &  &  &  \\
 & 1 & 84 & 0,01 & 0,03 & -0,52 & -0,08 & 0,03 & 0,02 & 0,03 & 0,04 & 0,04 \\
Shape 2 & 1 & 84 & 0,01 & 0,03 & -0,52 & -0,08 & 0 & 0,03 & 0,03 & 0,04 & 0,04 \\
Admin censJr & 1 & 84 & 0,01 & 0,03 & -0,51 & 0,01 & 0,02 & 0,02 & 0,02 & 0,02 & 0,02 \\
\multicolumn{4}{l}{\textit{Per cent error in model standard error}}  &  &  &  &  &  &  &  &  \\
Base case & 0 & 336 & 0 & 1 & 71 & 4 & -1 & 0 & -1 & 0 & 1 \\
 &  &  &  &  &  &  &  &  &  &  &  \\
 & 0.5 & 336 & 0 & 1 & 73 & 5 & 0 & -1 & 0 & 0 & 0 \\
 &  &  &  &  &  &  &  &  &  &  &  \\
 & 1 & 84 & -2 & -6 & 74 & 4 & -2 & -4 & -2 & -4 & -2 \\
Shape 2 & 1 & 84 & -2 & -6 &74 &4 &0 &-2 &-2 &-4 &-2   \\
Admincens & 1 & 84 & -4 & -1 & 74 & -1 & -2 & -2 & -2 & 0 & 0 \\
Power &  &  &  &  &  &  &  &  &  &  &  \\
Basecase & 0,5 & 336 & 92 & 65 & 14 & 59 & 65 & 62 & 65 & 64 & 64 \\
 &  &  &  &  &  &  &  &  &  &  &  \\
 & 1 & 84 & 92 & 64 & 12 & 57 & 64 & 60 & 63 & 64 & 65 \\
Shape 2 & 1 & 84 & 92 & 64 & 12 & 57 & 63 & 64 & 63 & 64 & 64 \\
Admincens & 1 & 84 & 96 & 73 & 17 & 71 & 73 & 73 & 72 & 71 & 71 \\ \hline
\multicolumn{12}{l}{Base case: TIM =0.5, nx =0.5, 17:0.002, shape K=1, random censoring with itc=0.002.} \\
\multicolumn{12}{l}{1LAdministrative censoring.} \\
\multicolumn{12}{l}{Monte Carlo error: £0016 for bias, \$4 per cent for per cent error in model standard error, g I.6 per cent for power. Bold cells have bias greater} \\
\multicolumn{12}{l}{than 0.03, more than 10 per cent error in model standard error or power more than 3 per cent worse than method T.                                               }
\end{tabular}
\end{sidewaystable}
\end{document}

Made the table in Excel -> Copied over to http://www.tablesgenerator.com/latex_tables -> Generated and coped only the tabular environment to Latex. Made fine-adjustments there. Still several typos though.

Share:
1,415

Related videos on Youtube

statm
Author by

statm

Updated on February 25, 2020

Comments

  • statm
    statm over 3 years

    I am trying to create a table in LateX that looks like the following: enter image description here

    Can anyone please help me?