How to improve latex table - latex

In this table, how can I have the upper line that matches between the two tables? I would like to have two tables with the same height. Here is the code that I used to create the table
\documentclass{article}
\usepackage{geometry}
\usepackage{textcomp}
\usepackage{adjustbox}
\usepackage{mathtools}
\usepackage{booktabs} %
\usepackage[group-separator={,}]{siunitx}
\usepackage{changepage}
\newcommand{\undepth}[1]{%
\smash[b]{%
\begin{varwidth}[t]{\linewidth}#1\end{varwidth}
}%
}
\usepackage{makecell}%To keep spacing of text in tables
\begin{document}
\begin{table}[htbp!]
\centering
\footnotesize
\caption{caption}
\begin{tabular}{lSSSS}
\toprule
\makecell[cc]{column1 \\ second line} & \multicolumn{1}{l}{column2} & \multicolumn{1}{l}{column3} & \multicolumn{1}{l}{column4} & \multicolumn{1}{l}{column5} \\
\midrule
A & 4 & 0 & 0.00 & 4 \\
B & 30 & 0 & 0.00 & 30 \\
\bottomrule
\end{tabular}
\quad
\footnotesize
\begin{tabular}{lSS}
\toprule
& {Column1.1 } & {Column2.1}\\
\midrule
A & 0.02 & 0.00 \\
B & 0.04 & 0.00 \\
\bottomrule
\end{tabular}%
\end{table}%
\end{document}

Quick hack:
Put some invisible dummy header of the same height as in the other table
\documentclass{article}
\usepackage{geometry}
\usepackage{textcomp}
\usepackage{adjustbox}
\usepackage{mathtools}
\usepackage{booktabs} %
\usepackage[group-separator={,}]{siunitx}
\usepackage{changepage}
\newcommand{\undepth}[1]{%
\smash[b]{%
\begin{varwidth}[t]{\linewidth}#1\end{varwidth}
}%
}
\usepackage{makecell}%To keep spacing of text in tables
\begin{document}
\begin{table}[htbp!]
\centering
\footnotesize
\caption{caption}
\begin{tabular}{lSSSS}
\toprule
\makecell[cc]{column1 \\ second line} & \multicolumn{1}{l}{column2} & \multicolumn{1}{l}{column3} & \multicolumn{1}{l}{column4} & \multicolumn{1}{l}{column5} \\
\midrule
A & 4 & 0 & 0.00 & 4 \\
B & 30 & 0 & 0.00 & 30 \\
\bottomrule
\end{tabular}
\quad
\footnotesize
\begin{tabular}{lSS}
\toprule
\makecell[cc]{\mbox{} \\ \mbox{}} & {Column1.1 } & {Column2.1}\\
\midrule
A & 0.02 & 0.00 \\
B & 0.04 & 0.00 \\
\bottomrule
\end{tabular}%
\end{table}%
\end{document}
Cleaner solution:
Use only one tabular
\documentclass{article}
\usepackage{geometry}
\usepackage{textcomp}
\usepackage{adjustbox}
\usepackage{mathtools}
\usepackage{booktabs} %
\usepackage[group-separator={,}]{siunitx}
\usepackage{changepage}
\newcommand{\undepth}[1]{%
\smash[b]{%
\begin{varwidth}[t]{\linewidth}#1\end{varwidth}
}%
}
\usepackage{makecell}%To keep spacing of text in tables
\begin{document}
\begin{table}[htbp!]
\centering
\footnotesize
\caption{caption}
\begin{tabular}{lSSSSSS}
\cmidrule[\heavyrulewidth](r){1-5}\cmidrule[\heavyrulewidth](l){6-7}
\makecell[cc]{column1 \\ second line} & \multicolumn{1}{l}{column2} & \multicolumn{1}{l}{column3} & \multicolumn{1}{l}{column4} & \multicolumn{1}{l}{column5} & {Column1.1 } & {Column2.1} \\
\cmidrule(r){1-5}\cmidrule(l){6-7}
A & 4 & 0 & 0.00 & 4 & 0.02 & 0.00 \\
B & 30 & 0 & 0.00 & 30 & 0.04 & 0.00 \\
\cmidrule[\heavyrulewidth](r){1-5}\cmidrule[\heavyrulewidth](l){6-7}
\end{tabular}%
\end{table}%
\end{document}

Related

Latex Table goes out of margins

I have the following code which worked in my previous latex template, but now I have to submit to a journal and the tables goes out of the margin. I tried to use \resizebox{\textwidth}{!}{% ...} it does work. I have attached the code below for help.
\documentclass[10pt, twoside]{article}
\usepackage[b5j,hmargin={1 in,0.6 in},vmargin={1 in,0.6 in}]{geometry}
\usepackage{times}
\usepackage[labelsep=space, labelfont=bf]{caption}
\usepackage{amsmath,amssymb,amsthm,latexsym}
\begin{document}
\begin{table}[htbp]
\caption{Parameter estimates }
\label{tab:Application_MOTLOBXL1}
\begin{tabular}{lccccccccccccc}
\hline
Distribution & \multicolumn{4}{c}{Estimates} & -2Log(L) & AIC & AICC & BIC & $W^{*}$ & $A^{*}$ & K-S & P-value & SS \\ \hline
MOTLOBX-L & \begin{tabular}[c]{#{}c#{}}$\alpha$\\ 2.62$\times 10^{-3}$\\ (8.33$\times 10^{-4}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\theta$\\ 1.21$\times 10^{1}$\\ (2.94$\times 10^{-4}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\delta$\\ 1.06$\times 10^{3}$\\ (1.41$\times 10^{-9}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 1.13\\ (5.42$\times 10^{-2}$)\end{tabular} & 24.4 & 32.4 & 33.1 & 41.0 & 0.0639 & 0.3929 & 0.0891 & 0.6998 & 0.0581 \\ \hline
MOTLOBX-W & \begin{tabular}[c]{#{}c#{}}$\alpha$\\ 5.71$\times 10^{-3}$\\ (2.01$\times 10^{-3}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\theta$\\ 8.45$\times 10^{1}$\\ (6.09$\times 10^{-6}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\delta$\\ 8.12$\times 10^{2}$\\ (1.28$\times 10^{-8}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\lambda$\\ 3.61$\times 10^{-1}$\\ (2.07$\times 10^{-2}$)\end{tabular} & 25.1 & 33.1 & 33.8 & 41.7 & 0.1076 & 0.6042 & 0.0971 & 0.5928 & 0.0840 \\ \hline
WL & \begin{tabular}[c]{#{}c#{}}$a$\\ 3.29$\times 10^{-1}$\\ (6.38$\times 10^{-2}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$b$\\ 3.97\\ (3.85$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\alpha$\\ 7.24$\times 10^{3}$\\ (6.30$\times 10^{-5}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 1.41$\times 10^{4}$\\ (3.25$\times 10^{-5}$)\end{tabular} & 29.1 & 37.1 & 37.8 & 45.6 & 0.1962 & 1.0892 & 0.1425 & 0.1544 & 0.1813\\ \hline
GBXII & \begin{tabular}[c]{#{}c#{}}$a$\\ 3.01$\times 10^{-2}$\\ (3.27$\times 10^{-2}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$b$\\ 1.42\\ (5.97$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$c$\\ 1.57\\ (5.42$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\theta$\\ 3.22\\ (1.87)\end{tabular} & 28.0 & 36.0 & 36.7 & 44.6 & 0.1616 & 0.9076 & 0.1318 & 0.2240 & 0.1504\\ \hline
MOOBII-Lo & \begin{tabular}[c]{#{}c#{}}$\delta$\\ 4.51$\times 10^{2}$\\ (4.34$\times 10^{-6}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\alpha$\\ 1.96\\ (1.71$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 9.20$\times 10^{-2}$\\ (4.17$\times 10^{-2}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\lambda$\\ 4.45\\ (7.51$\times 10^{-2}$)\end{tabular} & 40.4 & 48.4 & 49.1 & 57.0 & 0.3724 & 2.0787 & 0.1412 & 0.1619 & 0.2428\\ \hline
MOOBII-L & \begin{tabular}[c]{#{}c#{}}$\delta$\\ 7.08$\times 10^{2}$\\ (1.74$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\alpha$\\ 1.07$\times 10^{2}$\\ (3.24$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 1.14$\times 10^{1}$\\ (1.14$\times 10^{1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\lambda$\\ 1.84$\times 10^{1}$\\ (1.89)\end{tabular} & 32.0 & 40.0 & 40.7 & 48.6 & 0.2639 & 1.4517 & 0.1257 & 0.2727 & 0.1704\\ \hline
TLOBX-L & \begin{tabular}[c]{#{}c#{}}$\alpha$\\ 3.17$\times 10^{-1}$\\ (1.56$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\theta$\\ 1.99$\times 10^{1}$\\ (8.88)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 9.13$\times 10^{-1}$\\ (6.17$\times 10^{-2}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}} - \end{tabular} & 42.3 & 48.3 & 48.7 & 54.7 & 0.4676 & 2.5657 & 0.2280 & 0.0029 & 0.6164 \\ \hline
TL-L & \begin{tabular}[c]{#{}c#{}}$\alpha$\\ 4.22$\times 10^{-1}$\\ (2.96$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\theta$\\ 9.53\\ (5.85)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 3.53\\ (3.85$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}} - \end{tabular} & 62.6 & 68.6 & 69.0 & 75.0 & 0.6755 & 3.6946 & 0.3781 & $<0.0001$ & 2.4809 \\ \hline
MO-L & \begin{tabular}[c]{#{}c#{}}$\delta$\\ 2.85$\times 10^{1}$\\ (1.27$\times 10^{1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 7.92\\ (8.73$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}-\end{tabular} & \begin{tabular}[c]{#{}c#{}} - \end{tabular} & 45.6 & 49.6 & 49.8 & 53.9 & 0.4969 & 2.7489 & 0.1537 & 0.1019
& 0.3005 \\ \hline
OBX-L & \begin{tabular}[c]{#{}c#{}}$\theta$\\ 5.83\\ (7.73$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 1.03\\ (6.09$\times 10^{-2}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}-\end{tabular} & \begin{tabular}[c]{#{}c#{}} - \end{tabular} & 45.6 & 51.7 & 51.9 & 56.0 & 0.5629 & 3.0915 & 0.2313 & 0.0024 & 0.6509 \\ \hline
\end{tabular}%
\end{table}
\end{document}
I am not sure if you have already submitted but I'd have a few improvements for you. Mostly, I changed to slightly better rules, formatted numbers and added extra vertical spaces for better presentation (also see the comments in the code)
\documentclass[10pt, twoside]{article}
\usepackage[b5j,hmargin={1 in,0.6 in},vmargin={1 in,0.6 in}]{geometry}
\usepackage{array}
\usepackage{times}
\usepackage{caption}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{rotating}
% sidwaystable environment does not rotate pages when viewing PDFs
% In twoside documents and no option is given to the package,
% sidewaystable rotates table such that bottom edge is facing outer margin.
% figuresright - bottom edge always turned to the right
% figureleft - bottom edge always turned to the left
\usepackage{booktabs} % improved rules
\usepackage{siunitx} % S type column to formnat numbers
\captionsetup[table]{
skip=3pt,
position=top,
labelsep=space,
labelfont=bf,
}
\sisetup{
round-mode=places,
round-precision=2,
table-format=1.2,
}
\newcommand\mlrule{\midrule[\cmidrulewidth]}
\begin{document}
\begin{sidewaystable}[htbp]
\renewcommand*{\arraystretch}{1.05}
\setlength\extrarowheight{-3pt}
\small
\centering
\caption{Parameter estimates}\label{tab:Application_MOTLOBXL1}
\begin{tabular}{l *8{c} *5{S}}
\toprule\rule[-4pt]{0pt}{13pt}
Distribution & \multicolumn{4}{c}{Estimates} & -2Log(L) & AIC & AICC & BIC & {$W^{*}$} & {$A^{*}$} & {K-S} & {P-value} & {SS} \\ \midrule
MOTLOBX-L
& \begin{tabular}[c]{#{}c#{}}
$\alpha$ \\
2.62$\times 10^{-3}$\\
(8.33$\times 10^{-4}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\theta$ \\
1.21$\times 10^{1}$ \\
(2.94$\times 10^{-4}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\delta$ \\
1.06$\times 10^{3}$ \\
(1.41$\times 10^{-9}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\beta$ \\
1.13 \\
(5.42$\times 10^{-2}$)
\end{tabular} & 24.4 & 32.4 & 33.1 & 41.0 & 0.0639 & 0.3929 & 0.0891 & 0.6998 & 0.0581 \\ \mlrule
MOTLOBX-W
& \begin{tabular}[c]{#{}c#{}}
$\alpha$ \\
5.71$\times 10^{-3}$ \\
(2.01$\times 10^{-3}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\theta$ \\
8.45$\times 10^{1}$ \\
(6.09$\times 10^{-6}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\delta$ \\
8.12$\times 10^{2}$ \\
(1.28$\times 10^{-8}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\lambda$ \\
3.61$\times 10^{-1}$ \\
(2.07$\times 10^{-2}$)
\end{tabular} & 25.1 & 33.1 & 33.8 & 41.7 & 0.1076 & 0.6042 & 0.0971 & 0.5928 & 0.0840 \\ \mlrule
WL
& \begin{tabular}[c]{#{}c#{}}
$a$ \\
3.29$\times 10^{-1}$ \\
(6.38$\times 10^{-2}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$b$ \\
3.97 \\
(3.85$\times 10^{-1}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\alpha$ \\
7.24$\times 10^{3}$ \\
(6.30$\times 10^{-5}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\beta$ \\
1.41$\times 10^{4}$ \\
(3.25$\times 10^{-5}$)
\end{tabular} & 29.1 & 37.1 & 37.8 & 45.6 & 0.1962 & 1.0892 & 0.1425 & 0.1544 & 0.1813 \\ \mlrule
GBXII
& \begin{tabular}[c]{#{}c#{}}
$a$ \\
3.01$\times 10^{-2}$ \\
(3.27$\times 10^{-2}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$b$ \\
1.42 \\
(5.97$\times 10^{-1}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$c$ \\
1.57 \\
(5.42$\times 10^{-1}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\theta$ \\
3.22 \\
(1.87)
\end{tabular} & 28.0 & 36.0 & 36.7 & 44.6 & 0.1616 & 0.9076 & 0.1318 & 0.2240 & 0.1504 \\ \mlrule
MOOBII-Lo
& \begin{tabular}[c]{#{}c#{}}
$\delta$ \\
4.51$\times 10^{2}$ \\
(4.34$\times 10^{-6}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\alpha$ \\
1.96 \\
(1.71$\times 10^{-1}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\beta$ \\
9.20$\times 10^{-2}$ \\
(4.17$\times 10^{-2}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\lambda$ \\
4.45 \\
(7.51$\times 10^{-2}$)
\end{tabular} & 40.4 & 48.4 & 49.1 & 57.0 & 0.3724 & 2.0787 & 0.1412 & 0.1619 & 0.2428 \\ \mlrule
MOOBII-L
& \begin{tabular}[c]{#{}c#{}}
$\delta$ \\
7.08$\times 10^{2}$ \\
(1.74$\times 10^{-1}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\alpha$ \\
1.07$\times 10^{2}$ \\
(3.24$\times 10^{-1}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\beta$ \\
1.14$\times 10^{1}$ \\
(1.14$\times 10^{1}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\lambda$ \\
1.84$\times 10^{1}$ \\
(1.89)
\end{tabular} & 32.0 & 40.0 & 40.7 & 48.6 & 0.2639 & 1.4517 & 0.1257 & 0.2727 & 0.1704 \\ \mlrule
TLOBX-L
& \begin{tabular}[c]{#{}c#{}}
$\alpha$ \\
3.17$\times 10^{-1}$ \\
(1.56$\times 10^{-1}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\theta$ \\
1.99$\times 10^{1}$ \\
(8.88)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\beta$ \\
9.13$\times 10^{-1}$ \\
(6.17$\times 10^{-2}$)
\end{tabular}
& -- & 42.3 & 48.3 & 48.7 & 54.7 & 0.4676 & 2.5657 & 0.2280 & 0.0029$^{**}$ & 0.6164 \\ \mlrule
TL-L
& \begin{tabular}[c]{#{}c#{}}
$\alpha$ \\
4.22$\times 10^{-1}$ \\
(2.96$\times 10^{-1}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\theta$ \\
9.53 \\
(5.85)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\beta$ \\
3.53 \\
(3.85$\times 10^{-1}$)
\end{tabular}
& -- & 62.6 & 68.6 & 69.0 & 75.0 & 0.6755 & 3.6946 & 0.3781 & 0.0001$^{*}$ & 2.4809 \\ \mlrule
MO-L
& \begin{tabular}[c]{#{}c#{}}
$\delta$ \\
2.85$\times 10^{1}$ \\
(1.27$\times 10^{1}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\beta$ \\
7.92 \\
(8.73$\times 10^{-1}$)
\end{tabular}
& -- & -- & 45.6 & 49.6 & 49.8 & 53.9 & 0.4969 & 2.7489 & 0.1537 & 0.1019
& 0.3005 \\
\mlrule
OBX-L
& \begin{tabular}[c]{#{}c#{}}
$\theta$ \\
5.83 \\
(7.73$\times 10^{-1}$)
\end{tabular}
& \begin{tabular}[c]{#{}c#{}}
$\beta$ \\
1.03 \\
(6.09$\times 10^{-2}$)
\end{tabular}
& -- & -- & 45.6 & 51.7 & 51.9 & 56.0 & 0.5629 & 3.0915 & 0.2313 & 0.0024$^{**}$ & 0.6509 \\ \midrule[\heavyrulewidth]
\multicolumn{14}{#{}l}{$^{*}$p-value $<0.0001$, \qquad$^{**}$p-value $<0.005$}
\end{tabular}%
\end{sidewaystable}
\end{document}
You could use a (bit) smaller font and place this table on a landscape page:
\documentclass[10pt, twoside]{article}
\usepackage[b5j,hmargin={1 in,0.6 in},vmargin={1 in,0.6 in}]{geometry}
\usepackage{times}
\usepackage[labelsep=space, labelfont=bf]{caption}
\usepackage{amsmath,amssymb,amsthm,latexsym}
\usepackage{lscape}
\begin{document}
\begin{landscape}
\begin{table}[htbp]
\caption{Parameter estimates }
\label{tab:Application_MOTLOBXL1}
\footnotesize
\begin{tabular}{lccccccccccccc}
\hline
Distribution & \multicolumn{4}{c}{Estimates} & -2Log(L) & AIC & AICC & BIC & $W^{*}$ & $A^{*}$ & K-S & P-value & SS \\ \hline
MOTLOBX-L & \begin{tabular}[c]{#{}c#{}}$\alpha$\\ 2.62$\times 10^{-3}$\\ (8.33$\times 10^{-4}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\theta$\\ 1.21$\times 10^{1}$\\ (2.94$\times 10^{-4}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\delta$\\ 1.06$\times 10^{3}$\\ (1.41$\times 10^{-9}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 1.13\\ (5.42$\times 10^{-2}$)\end{tabular} & 24.4 & 32.4 & 33.1 & 41.0 & 0.0639 & 0.3929 & 0.0891 & 0.6998 & 0.0581 \\ \hline
MOTLOBX-W & \begin{tabular}[c]{#{}c#{}}$\alpha$\\ 5.71$\times 10^{-3}$\\ (2.01$\times 10^{-3}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\theta$\\ 8.45$\times 10^{1}$\\ (6.09$\times 10^{-6}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\delta$\\ 8.12$\times 10^{2}$\\ (1.28$\times 10^{-8}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\lambda$\\ 3.61$\times 10^{-1}$\\ (2.07$\times 10^{-2}$)\end{tabular} & 25.1 & 33.1 & 33.8 & 41.7 & 0.1076 & 0.6042 & 0.0971 & 0.5928 & 0.0840 \\ \hline
WL & \begin{tabular}[c]{#{}c#{}}$a$\\ 3.29$\times 10^{-1}$\\ (6.38$\times 10^{-2}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$b$\\ 3.97\\ (3.85$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\alpha$\\ 7.24$\times 10^{3}$\\ (6.30$\times 10^{-5}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 1.41$\times 10^{4}$\\ (3.25$\times 10^{-5}$)\end{tabular} & 29.1 & 37.1 & 37.8 & 45.6 & 0.1962 & 1.0892 & 0.1425 & 0.1544 & 0.1813\\ \hline
GBXII & \begin{tabular}[c]{#{}c#{}}$a$\\ 3.01$\times 10^{-2}$\\ (3.27$\times 10^{-2}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$b$\\ 1.42\\ (5.97$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$c$\\ 1.57\\ (5.42$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\theta$\\ 3.22\\ (1.87)\end{tabular} & 28.0 & 36.0 & 36.7 & 44.6 & 0.1616 & 0.9076 & 0.1318 & 0.2240 & 0.1504\\ \hline
MOOBII-Lo & \begin{tabular}[c]{#{}c#{}}$\delta$\\ 4.51$\times 10^{2}$\\ (4.34$\times 10^{-6}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\alpha$\\ 1.96\\ (1.71$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 9.20$\times 10^{-2}$\\ (4.17$\times 10^{-2}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\lambda$\\ 4.45\\ (7.51$\times 10^{-2}$)\end{tabular} & 40.4 & 48.4 & 49.1 & 57.0 & 0.3724 & 2.0787 & 0.1412 & 0.1619 & 0.2428\\ \hline
MOOBII-L & \begin{tabular}[c]{#{}c#{}}$\delta$\\ 7.08$\times 10^{2}$\\ (1.74$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\alpha$\\ 1.07$\times 10^{2}$\\ (3.24$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 1.14$\times 10^{1}$\\ (1.14$\times 10^{1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\lambda$\\ 1.84$\times 10^{1}$\\ (1.89)\end{tabular} & 32.0 & 40.0 & 40.7 & 48.6 & 0.2639 & 1.4517 & 0.1257 & 0.2727 & 0.1704\\ \hline
TLOBX-L & \begin{tabular}[c]{#{}c#{}}$\alpha$\\ 3.17$\times 10^{-1}$\\ (1.56$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\theta$\\ 1.99$\times 10^{1}$\\ (8.88)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 9.13$\times 10^{-1}$\\ (6.17$\times 10^{-2}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}} - \end{tabular} & 42.3 & 48.3 & 48.7 & 54.7 & 0.4676 & 2.5657 & 0.2280 & 0.0029 & 0.6164 \\ \hline
TL-L & \begin{tabular}[c]{#{}c#{}}$\alpha$\\ 4.22$\times 10^{-1}$\\ (2.96$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\theta$\\ 9.53\\ (5.85)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 3.53\\ (3.85$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}} - \end{tabular} & 62.6 & 68.6 & 69.0 & 75.0 & 0.6755 & 3.6946 & 0.3781 & $<0.0001$ & 2.4809 \\ \hline
MO-L & \begin{tabular}[c]{#{}c#{}}$\delta$\\ 2.85$\times 10^{1}$\\ (1.27$\times 10^{1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 7.92\\ (8.73$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}-\end{tabular} & \begin{tabular}[c]{#{}c#{}} - \end{tabular} & 45.6 & 49.6 & 49.8 & 53.9 & 0.4969 & 2.7489 & 0.1537 & 0.1019
& 0.3005 \\ \hline
OBX-L & \begin{tabular}[c]{#{}c#{}}$\theta$\\ 5.83\\ (7.73$\times 10^{-1}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}$\beta$\\ 1.03\\ (6.09$\times 10^{-2}$)\end{tabular} & \begin{tabular}[c]{#{}c#{}}-\end{tabular} & \begin{tabular}[c]{#{}c#{}} - \end{tabular} & 45.6 & 51.7 & 51.9 & 56.0 & 0.5629 & 3.0915 & 0.2313 & 0.0024 & 0.6509 \\ \hline
\end{tabular}%
\end{table}
\end{landscape}
\end{document}
I find it a bit difficult to make good looking tables in LaTeX, so I usually use this site: https://www.tablesgenerator.com/.
It lets you create your table and then it spits out the LaTeX code.
I hope you can use it.

How to add index outside a table in latex

How to add index outside a table like this?
Thanks!
Going out on a limb here, I assume you want to create the indeces in the smaller font size...
I extended the table and reduzed the font size for the indeces. Using the array package for the rest.
Minimal working the solution:
\documentclass{article}
\usepackage{array}
\begin{document}
\begin{table}
\centering
\begin{tabular}{ccccc}
& {\scriptsize 1} & {\scriptsize 2} & {\scriptsize 3} & {\scriptsize 4} \\ \cline{2-5}
{\scriptsize 1} & \multicolumn{1}{|c|}{0} &\multicolumn{1}{|c|}{ }& \multicolumn{1}{|c|}{-2}& \multicolumn{1}{|c|}{ } \\ \cline{2-5}
{\scriptsize 2} & \multicolumn{1}{|c|}{ } &\multicolumn{1}{|c|}{0}& \multicolumn{1}{|c|}{ } & \multicolumn{1}{|c|}{ } \\ \cline{2-5}
{\scriptsize 3} & \multicolumn{1}{|c|}{ } &\multicolumn{1}{|c|}{ }& \multicolumn{1}{|c|}{0} & \multicolumn{1}{|c|}{ } \\ \cline{2-5}
{\scriptsize 4} & \multicolumn{1}{|c|}{ } &\multicolumn{1}{|c|}{ }& \multicolumn{1}{|c|}{ } & \multicolumn{1}{|c|}{0} \\ \cline{2-5}
\end{tabular}
\end{table}
\end{document}
With the following result:
You can choose a different font size for the indices, like \small, \footnotesize or \tiny.
A basic version trying to reduce the number of multicolumns used may be:
\documentclass{article}
\begin{document}
\begin{tabular}{*{5}{c|}}
\multicolumn{1}{c}{ } & \multicolumn{1}{c}{1} & \multicolumn{1}{c}{2} & \multicolumn{1}{c}{3} & \multicolumn{1}{c}{4}\\\cline{2-5}
1 & 0 & & -2 & \\\cline{2-5}
2 & & 0 & & \\\cline{2-5}
3 & & & 0 & \\\cline{2-5}
4 & & & & 0 \\\cline{2-5}
\end{tabular}
\end{document}

How to adjust the size of a highlighted table with centered text?

I need to write this exact same table in Latex (in the picture)
This is my code :
\documentclass[11pt]{article}
\usepackage{xcolor}
\usepackage{array,multirow,colortbl}
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,257mm},
left=20mm,
top=20mm,
}
\begin{document}
\colorbox{lightgray}{%
\arrayrulecolor{white}
\begin{tabular}{p{2.2in} | p{2.1in}}
\textbf{Signaleigenschaft} & \textbf{Mathematische Beschreibung} \\ \hline
Explizit definiertes Signal & Funktionswert kann direkt abgelesen werden,\newline zum Beispiel\newline
$x\left(t\right)=10\cdot e^{-a\cdot t^{2} } \cdot \sin \left(b\cdot t\right)$ \\
\end{tabular}%
}%end colorbox
\end{document}
I obtain a small table and the text isn't like in the picture (centered etc..)
Centered text and applied sans serif font for both text and equation. Used \parbox with specific height and width to match spacing of "this exact same table".
\documentclass[11pt]{article}
\usepackage{xcolor}
\usepackage{array,multirow,colortbl}
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,257mm},
left=20mm,
top=20mm,
}
\begin{document}
{
\scriptsize%
\sffamily%
\setlength{\fboxsep}{0pt}%
\colorbox{lightgray}{%
\arrayrulecolor{white}%
\begin{tabular}{| l | l |}
\hline
\parbox[c][0.28in][c]{2.5in}{\smallskip\centering\textbf{Signaleigenschaft}} & \parbox[c][0.28in][c]{2.5in}{\smallskip\centering\textbf{Mathematische Beschreibung}}\\ \hline
\parbox[c][0.64in][c]{2.5in}{\centering{Explizit definiertes Signal}} & \parbox[c][0.64in][c]{2.5in}{\centering{Funktionswert kann direkt abgelesen werden,\\zum Beispiel\\[3pt]$\mathsf{x\left(t\right)=10\cdot e^{-a\cdot t^{2} } \cdot \sin \left(b\cdot t\right)}$}}\\
\hline
\end{tabular}%
}%end colorbox
}
\end{document}
You could define a new, centred column type:
\documentclass[11pt]{article}
\usepackage{xcolor}
\usepackage{array,multirow,colortbl}
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,257mm},
left=20mm,
top=20mm,
}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\begin{document}
\colorbox{lightgray}{%
\arrayrulecolor{white}
\begin{tabular}{C{2.2in} | C{2.1in}}
\textbf{Signaleigenschaft} & \textbf{Mathematische Beschreibung} \\ \hline
Explizit definiertes Signal &
Funktionswert kann direkt abgelesen werden,\par
zum Beispiel\par
$x\left(t\right)=10\cdot e^{-a\cdot t^{2} } \cdot \sin \left(b\cdot t\right)$ \\
\end{tabular}%
}%end colorbox
\end{document}

how to center matrix in latex presentation

\centering
\[
\begin{matrix}
\hline P& \beta^{1p} &\beta^{2p} & \beta^{3p} & \beta^{4p} &E(c^{p}) &\sigma(\delta c^{p}) &E(r^{p}-r^{f}) & \sigma( r^{p}-r^{f}) \\
\hline 1& 1.4360 & 0.0018& -0.0123 &-0.0195 &0.0292 & 0.0048 &0.0013 &0.0809 \\
5& 1.1428 & 0.0007 &-0.0098 &-0.0091 & 0.0113 &0.0018 &0.0041 &0.0618 \\
10& 1.0108 & 0.0005 & -0.0083 & -0.0073 & 0.0086 &0.0013 &0.0042 &0.0544 \\
15& 0.9065 &0.0004 &-0.0080 &-0.0061 & 0.0068 & 0.0010 &0.0050 &0.0493 \\
20&0.7602 &0.0003 &-0.0065 & -0.0045 & 0.0050 &0.0008 & 0.0060 & 0.0417\\
25& 0.7192 & 0.0000 &-0.0061 & -0.0010 & 0.0020 & 0.0003 & 0.0068 &0.0417
\end{matrix}
\]
This is my code and I want this matrix to be more in center.

More thane one NewSavebox fails compilation

The following code has a problem with the second \newsavebox{\spec}. It does not compile. However if I use twice the \speciesone, i.e.:
\matrix [matrix of nodes] {
\node (species1) [shape=rectangle,draw] {\usebox{\speciesone}}; & \node (species2) [shape=rectangle,draw] {\usebox{\speciesone}};\\
};
I have no problem.
\documentclass[xcolor=pdftex,table,10pt,yellow,mathserif]{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\newsavebox{\speciesone}
\sbox{\speciesone}{
\begin{tabular}{c c c c}
\multicolumn{3}{c}{{$k~ \times $ 1}} \tabularnewline
\hline
$\vec{v} =$ & $v_{1}$ & $v_{2}$ & $v_{3}$ \tabularnewline
\hline
\hline
& $\circ$ & $\circ$ & $\circ$ \tabularnewline
\end{tabular}
}
\newsavebox{\spec}
\sbox{\spec}{
\begin{tabular}{c c c c}
\multicolumn{3}{c}{{$k~ \times $ 2}} \tabularnewline
\hline
$\vec{v} =$ & $v_{1}$ & $v_{2}$ & $v_{3}$ \tabularnewline
& $\circ$ & $\circ$ & $\circ$ \tabularnewline
\end{tabular}
}
\begin{document}
\begin{tikzpicture}
\matrix [matrix of nodes] {
\node (species1) [shape=rectangle,draw] {\usebox{\speciesone}}; & \node (species2) [shape=rectangle,draw] {\usebox{\spec}};\\
};
\end{tikzpicture}
\end{document}
To avoid Undefined control sequence... errors, you should cut \begin{document} and paste it before both
\newsavebox{\speciesone}
\sbox{\speciesone}{
...
}
and
\newsavebox{\spec}
\sbox{\spec}{
...
}

Resources