Latex subtables side by side - latex

I have been trying to setup those subtables as 2x5, but it is generated as one subtable per row.
I have tried minipage, parbox, resizebox and nothing I know could pack 5 subtables into a single row. The code is shortened to 2x2 example.
I would appreciate any sugestions.
Thanks :)
\begin{table*}
\centering
\caption{\textcolor{red}{Confusion matrices for well-known pretrained convolutional neural networks}}
\begin{subtable}[h!]{0.18\textwidth}
\centering
\begin{tabular}{ccccc}
& & \multicolumn{3}{c}{Predicted} \\
& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{C} & R \\ \cline{2-5}
\multirow{3}{*}{\rotatebox[origin=c]{90}{Actual}} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{60} & \multicolumn{1}{c|}{5} & 7\\ \cline{2-5}
& \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{8} & \multicolumn{1}{c|}{82} & 6\\ \cline{2-5}
& \multicolumn{1}{c|}{R} & \multicolumn{1}{c|}{6} & \multicolumn{1}{c|}{3} & 99
\end{tabular}
\subcaption{DenseNet 121}
\label{tab:conf_densenet121}
\end{subtable}
\hfill
\begin{subtable}[h!]{0.18\textwidth}
\centering
\begin{tabular}{ccccc}
& & \multicolumn{3}{c}{Predicted} \\
& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{C} & R \\ \cline{2-5}
\multirow{3}{*}{\rotatebox[origin=c]{90}{Actual}} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{65} & \multicolumn{1}{c|}{2} & 5\\ \cline{2-5}
& \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{7} & \multicolumn{1}{c|}{86} & 3\\ \cline{2-5}
& \multicolumn{1}{c|}{R} & \multicolumn{1}{c|}{4} & \multicolumn{1}{c|}{3} & 101
\end{tabular}
\subcaption{DenseNet 201}
\label{tab:conf_densenet201}
\end{subtable}
\vskip\baselineskip
\begin{subtable}[b]{0.18\textwidth}
\centering
\begin{tabular}{ccccc}
& & \multicolumn{3}{c}{Predicted} \\
& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{C} & R \\ \cline{2-5}
\multirow{3}{*}{\rotatebox[origin=c]{90}{Actual}} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{63} & \multicolumn{1}{c|}{4} & 5\\ \cline{2-5}
& \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{5} & \multicolumn{1}{c|}{90} & 1\\ \cline{2-5}
& \multicolumn{1}{c|}{R} & \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{4} & 101
\end{tabular}
\caption{ResNet50 V2}
\label{tab:conf_resnet50v2}
\end{subtable}
\hfill
\begin{subtable}[b]{0.18\textwidth}
\centering
\begin{tabular}{ccccc}
& & \multicolumn{3}{c}{Predicted} \\
& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{C} & R \\ \cline{2-5}
\multirow{3}{*}{\rotatebox[origin=c]{90}{Actual}} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{62} & \multicolumn{1}{c|}{6} & 4\\ \cline{2-5}
& \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{7} & \multicolumn{1}{c|}{88} & 1\\ \cline{2-5}
& \multicolumn{1}{c|}{R} & \multicolumn{1}{c|}{2} & \multicolumn{1}{c|}{4} & 102
\end{tabular}
\caption{ResNet152 V2}
\label{tab:conf_resnet152v2}
\end{subtable}
\label{tab:confusion}
\end{table*}

Update
I have substituted subfig with the actively maintained package subcaption; the last date subfig was updated is in 2005.
Here's the new code
\documentclass[journal]{IEEEtran}
\usepackage{xcolor}
\usepackage{multirow}
\usepackage{subcaption}
\usepackage{rotating}
\usepackage[colorlinks]{hyperref}
\usepackage{kantlipsum}
\captionsetup[table]{position=top,skip=12pt}
\captionsetup[subtable]{position=top,aboveskip=3pt}
\newcommand\actual{\multirow{3}{*}{\rotatebox[origin=c]{90}{Actual}}}
\newcommand\predicted{\multicolumn{3}{c}{Predicted}}
\begin{document}
\section{The first section}
\kant[1-5]
Reference to the Table~\ref{tab:conf_resnet}.
References to sub-tables:
\begin{itemize}
\item Table~\ref{tab:conf_densenet121}
\item Table~\ref{tab:conf_densenet201}
\item Table~\ref{tab:conf_densenet2011}
\item Table~\ref{tab:conf_resnet50v2}
\item Table~\ref{tab:conf_resnet152v2}
\item Table~\ref{tab:conf_resnet50v22}
\item Table~\ref{tab:conf_resnet152v22}
\item Table~\ref{tab:conf_resnet152v23}
\end{itemize}
\begin{table*}
\renewcommand*{\arraystretch}{1.35}
\setlength\tabcolsep{4pt}
\caption{\textcolor{red}{Confusion matrices for well-known pretrained convolutional neural networks}}
\label{tab:conf_resnet}
\hfill%
\subfloat[DenseNet 121]{%
\label{tab:conf_densenet121}%
\begin{tabular}{c *4{c|}}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \predicted \\
& & K & C & R \\ \cline{2-5}
\actual & K & 60 & 5 & 7 \\ \cline{2-5}
& C & 8 & 82 & 6 \\ \cline{2-5}
& R & 6 & 3 & 99
\end{tabular}}
\hfill%
\subfloat[DenseNet 201]{%
\label{tab:conf_densenet201}%
\begin{tabular}{c *4{c|}}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \predicted \\
& & K & C & R \\ \cline{2-5}
\actual & K & 65 & 2 & 5 \\ \cline{2-5}
& C & 7 & 86 & 3 \\ \cline{2-5}
& R & 4 & 3 & 101
\end{tabular}}%
\hfill%
\subfloat[DenseNet 201]{%
\label{tab:conf_densenet2011}%
\begin{tabular}{c *4{c|}}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \predicted \\
& & K & C & R \\ \cline{2-5}
\actual & K & 65 & 2 & 5 \\ \cline{2-5}
& C & 7 & 86 & 3 \\ \cline{2-5}
& R & 4 & 3 & 101
\end{tabular}}%
\hspace{\fill}
\vspace{12pt}
\hfill%
\subfloat[ResNet50 V2]{%
\label{tab:conf_resnet50v2}
\begin{tabular}{c *4{c|}}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \predicted \\
& & K & C & R \\ \cline{2-5}
\actual & K & 63 & 4 & 5 \\ \cline{2-5}
& C & 5 & 90 & 1 \\ \cline{2-5}
& R & 3 & 4 & 101
\end{tabular}}%
\hfill%
\subfloat[ResNet152 V2]{%
\label{tab:conf_resnet152v2}
\begin{tabular}{c *4{c|}}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \predicted \\
& & K & C & R \\ \cline{2-5}
\actual & K & 62 & 6 & 4 \\ \cline{2-5}
& C & 7 & 88 & 1 \\ \cline{2-5}
& R & 2 & 4 & 102
\end{tabular}}%
\hspace{\fill}
\vspace{12pt}
\hfill%
\subfloat[ResNet50 V2]{%
\label{tab:conf_resnet50v22}
\begin{tabular}{c *4{c|}}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \predicted \\
& & K & C & R \\ \cline{2-5}
\actual & K & 63 & 4 & 5 \\ \cline{2-5}
& C & 5 & 90 & 1 \\ \cline{2-5}
& R & 3 & 4 & 101
\end{tabular}}%
\hfill%
\subfloat[ResNet152 V2]{%
\label{tab:conf_resnet152v22}
\begin{tabular}{c *4{c|}}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \predicted \\
& & K & C & R \\ \cline{2-5}
\actual & K & 62 & 6 & 4 \\ \cline{2-5}
& C & 7 & 88 & 1 \\ \cline{2-5}
& R & 2 & 4 & 102
\end{tabular}}%
\hfill%
\subfloat[ResNet152 V2]{%
\label{tab:conf_resnet152v23}
\begin{tabular}{c *4{c|}}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \predicted \\
& & K & C & R \\ \cline{2-5}
\actual & K & 62 & 6 & 4 \\ \cline{2-5}
& C & 7 & 88 & 1 \\ \cline{2-5}
& R & 2 & 4 & 102
\end{tabular}}%
\hspace{\fill}
\end{table*}
\end{document}
If each table is going to be exactly the same, you can just use a simple pattern:
\hfill table \hfill table \hfill etc.
If they are going to be different, you can use tabular instead. Remember, if you want to place elements horizontally, you can't add extra empty lines. It causes LaTeX to start new paragraphs.
I created a grid of 3/2/3 tables. \subfloat[]{} is also a convenient macro to make sub-captions; it is defined in subfig. Any sub- related macro is only required if you want to make a reference to each individual table. If you don't, you can safely remove \subfloat along with subfig.
\documentclass[journal]{IEEEtran}
\usepackage{xcolor}
\usepackage{multirow}
\usepackage{subfig}
\usepackage{rotating}
\usepackage[colorlinks]{hyperref}
\usepackage{kantlipsum}
\captionsetup[table]{position=top,skip=12pt}
\captionsetup[subtable]{position=top,captionskip=2pt}
\begin{document}
\section{The first section}
\kant[1-5]
Reference to the Table~\ref{tab:conf_resnet}.
References to sub-tables:
\begin{itemize}
\item Table~\ref{tab:conf_densenet121}
\item Table~\ref{tab:conf_densenet201}
\item Table~\ref{tab:conf_densenet2011}
\item Table~\ref{tab:conf_resnet50v2}
\item Table~\ref{tab:conf_resnet152v2}
\item Table~\ref{tab:conf_resnet50v22}
\item Table~\ref{tab:conf_resnet152v22}
\item Table~\ref{tab:conf_resnet152v23}
\end{itemize}
\begin{table*}
\setlength\tabcolsep{4pt}
\caption{\textcolor{red}{Confusion matrices for well-known pretrained convolutional neural networks}}
\label{tab:conf_resnet}
\hfill%
\subfloat[DenseNet 121]{%
\label{tab:conf_densenet121}%
\begin{tabular}{ccccc}
& & \multicolumn{3}{c}{Predicted} \\
& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{C} & R \\ \cline{2-5}
\multirow{3}{*}{\rotatebox[origin=c]{90}{Actual}} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{60} & \multicolumn{1}{c|}{5} & 7\\ \cline{2-5}
& \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{8} & \multicolumn{1}{c|}{82} & 6\\ \cline{2-5}
& \multicolumn{1}{c|}{R} & \multicolumn{1}{c|}{6} & \multicolumn{1}{c|}{3} & 99
\end{tabular}}
\hfill%
\subfloat[DenseNet 201]{%
\label{tab:conf_densenet201}%
\begin{tabular}{ccccc}
& & \multicolumn{3}{c}{Predicted} \\
& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{C} & R \\ \cline{2-5}
\multirow{3}{*}{\rotatebox[origin=c]{90}{Actual}} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{65} & \multicolumn{1}{c|}{2} & 5\\ \cline{2-5}
& \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{7} & \multicolumn{1}{c|}{86} & 3\\ \cline{2-5}
& \multicolumn{1}{c|}{R} & \multicolumn{1}{c|}{4} & \multicolumn{1}{c|}{3} & 101
\end{tabular}}%
\hfill%
\subfloat[DenseNet 201]{%
\label{tab:conf_densenet2011}%
\begin{tabular}{ccccc}
& & \multicolumn{3}{c}{Predicted} \\
& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{C} & R \\ \cline{2-5}
\multirow{3}{*}{\rotatebox[origin=c]{90}{Actual}} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{65} & \multicolumn{1}{c|}{2} & 5\\ \cline{2-5}
& \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{7} & \multicolumn{1}{c|}{86} & 3\\ \cline{2-5}
& \multicolumn{1}{c|}{R} & \multicolumn{1}{c|}{4} & \multicolumn{1}{c|}{3} & 101
\end{tabular}}%
\hspace{\fill}
\vspace{12pt}
\hfill%
\subfloat[ResNet50 V2]{%
\label{tab:conf_resnet50v2}
\begin{tabular}{ccccc}
& & \multicolumn{3}{c}{Predicted} \\
& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{C} & R \\ \cline{2-5}
\multirow{3}{*}{\rotatebox[origin=c]{90}{Actual}} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{63} & \multicolumn{1}{c|}{4} & 5\\ \cline{2-5}
& \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{5} & \multicolumn{1}{c|}{90} & 1\\ \cline{2-5}
& \multicolumn{1}{c|}{R} & \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{4} & 101
\end{tabular}}%
\hfill%
\subfloat[ResNet152 V2]{%
\label{tab:conf_resnet152v2}
\begin{tabular}{ccccc}
& & \multicolumn{3}{c}{Predicted} \\
& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{C} & R \\ \cline{2-5}
\multirow{3}{*}{\rotatebox[origin=c]{90}{Actual}} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{62} & \multicolumn{1}{c|}{6} & 4\\ \cline{2-5}
& \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{7} & \multicolumn{1}{c|}{88} & 1\\ \cline{2-5}
& \multicolumn{1}{c|}{R} & \multicolumn{1}{c|}{2} & \multicolumn{1}{c|}{4} & 102
\end{tabular}}%
\hspace{\fill}
\vspace{12pt}
\hfill%
\subfloat[ResNet50 V2]{%
\label{tab:conf_resnet50v22}
\begin{tabular}{ccccc}
& & \multicolumn{3}{c}{Predicted} \\
& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{C} & R \\ \cline{2-5}
\multirow{3}{*}{\rotatebox[origin=c]{90}{Actual}} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{63} & \multicolumn{1}{c|}{4} & 5\\ \cline{2-5}
& \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{5} & \multicolumn{1}{c|}{90} & 1\\ \cline{2-5}
& \multicolumn{1}{c|}{R} & \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{4} & 101
\end{tabular}}%
\hfill%
\subfloat[ResNet152 V2]{%
\label{tab:conf_resnet152v22}
\begin{tabular}{ccccc}
& & \multicolumn{3}{c}{Predicted} \\
& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{C} & R \\ \cline{2-5}
\multirow{3}{*}{\rotatebox[origin=c]{90}{Actual}} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{62} & \multicolumn{1}{c|}{6} & 4\\ \cline{2-5}
& \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{7} & \multicolumn{1}{c|}{88} & 1\\ \cline{2-5}
& \multicolumn{1}{c|}{R} & \multicolumn{1}{c|}{2} & \multicolumn{1}{c|}{4} & 102
\end{tabular}}%
\hfill%
\subfloat[ResNet152 V2]{%
\label{tab:conf_resnet152v23}
\begin{tabular}{ccccc}
& & \multicolumn{3}{c}{Predicted} \\
& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{C} & R \\ \cline{2-5}
\multirow{3}{*}{\rotatebox[origin=c]{90}{Actual}} & \multicolumn{1}{c|}{K} & \multicolumn{1}{c|}{62} & \multicolumn{1}{c|}{6} & 4\\ \cline{2-5}
& \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{7} & \multicolumn{1}{c|}{88} & 1\\ \cline{2-5}
& \multicolumn{1}{c|}{R} & \multicolumn{1}{c|}{2} & \multicolumn{1}{c|}{4} & 102
\end{tabular}}%
\hspace{\fill}
\end{table*}
\end{document}

Related

Overleaf: How do I add another row in my table?

I have a longtable and I would like that both the first part and the second part of the table are identical. As you can see in the figure, on the first page you have a row "test (total) | test | test | test |Stest | test" . I would also like to see this on the second page (to increase readability of the table)
`
\documentclass[a4paper]{report}
\usepackage[a4paper, total={6in, 9in}]{geometry}
\usepackage{graphicx} % Required for box manipulation
\usepackage{helvet}
\usepackage{subfig}
\usepackage[utf8]{inputenc}
%\usepackage{natbib}
\usepackage[square, comma, sort&compress]{natbib}
\usepackage[USenglish]{babel}
\usepackage[useregional]{datetime2}
\usepackage{pgfgantt}
\usepackage{listings}
\usepackage{wrapfig}
\usepackage{setspace}
\usepackage{parskip} % Used to create spaces between paragraphs
\usepackage{dirtytalk} % quotes by talk
%\usepackage[hidelinks]{hyperref}
\usepackage[colorlinks=true,citecolor=red]{hyperref}
\usepackage[acronym, toc]{glossaries} % Used to add a wordlist/glossaries
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{color, colortbl}
\usepackage{booktabs}
\usepackage{float}
\usepackage{csquotes}
%zelf toegevoegd
\usepackage[most]{tcolorbox}
\usepackage{multirow} %table
\usepackage{xcolor,colortbl}
\usepackage{pdflscape}
\usepackage{pifont} %%%bullet points
\usepackage{longtable}
\usepackage{graphicx}
%\usepackage{geometry} %table margin
\begin{longtable}{l|ccc|ccc|}
\caption{test}
\label{test}\\
\cline{2-7}
& \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{Duration test}} & \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{test(Count)}} \\ \hline
\endfirsthead
%
\multicolumn{7}{c}%
{{\bfseries Table \thetable\ continued from previous page}} \\
\cline{2-7}
& \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{Duration test)}} & \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{test(Count)}} \\ \hline
\endhead
%
\multicolumn{1}{|l|}{\cellcolor[HTML]{EFEFEF}test(Total)} &
\multicolumn{1}{|c|}{\cellcolor[HTML]{EFEFEF}test} &
\multicolumn{1}{c|}{\cellcolor[HTML]{EFEFEF}test} &
{\cellcolor[HTML]{EFEFEF}test} &
\multicolumn{1}{|c|}{\cellcolor[HTML]{EFEFEF}test} &
\multicolumn{1}{c|}{\cellcolor[HTML]{EFEFEF}test} &
{\cellcolor[HTML]{EFEFEF}test} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:04} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{07:21} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{47} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:18} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:18} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:40} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{9} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{01:20} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{24} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:50} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{7} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:16} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{2} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:28} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{7} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:24} & \multicolumn{1}{c|}{NOB} & \multicolumn{1}{c|}{NOB}
& \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{NOB} & \multicolumn{1}{c|}{NOB} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{01:53} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{33} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{04:32} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{63} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:05} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{13:21} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{128} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:16} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{4} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:25} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{6} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{10:19} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{41} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:26} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{10} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:07} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:12} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:14} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{2} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{NOB} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{NOB} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{\textbf{Grand Total}} & \multicolumn{1}{c|}{43:49} & \multicolumn{1}{c|}{43:25} & \multicolumn{1}{c|}{48:50}
& \multicolumn{1}{c|}{401} & \multicolumn{1}{c|}{397} & \multicolumn{1}{c|}{51} \\\hline
\end{longtable}
`
I tried to duplicate the following part of the code
`
\multicolumn{1}{|l|}{\cellcolor[HTML]{EFEFEF}test(Total)} &
\multicolumn{1}{|c|}{\cellcolor[HTML]{EFEFEF}test} &
\multicolumn{1}{c|}{\cellcolor[HTML]{EFEFEF}test} &
{\cellcolor[HTML]{EFEFEF}test} &
\multicolumn{1}{|c|}{\cellcolor[HTML]{EFEFEF}test} &
\multicolumn{1}{c|}{\cellcolor[HTML]{EFEFEF}test} &
{\cellcolor[HTML]{EFEFEF}test} \\ \hline
`
You can add the row you want to appear at the top of every page to your longtable header.
Wrapping each and every cell into a \multicolumn is neither necessary nor useful for anything.
\documentclass[a4paper]{report}
\usepackage[a4paper, total={6in, 9in}]{geometry}
\usepackage{graphicx} % Required for box manipulation
\usepackage{helvet}
\usepackage{subfig}
\usepackage[utf8]{inputenc}
%\usepackage{natbib}
\usepackage[square, comma, sort&compress]{natbib}
\usepackage[USenglish]{babel}
\usepackage[useregional]{datetime2}
\usepackage{pgfgantt}
\usepackage{listings}
\usepackage{wrapfig}
\usepackage{setspace}
\usepackage{parskip} % Used to create spaces between paragraphs
\usepackage{dirtytalk} % quotes by talk
%\usepackage[hidelinks]{hyperref}
\usepackage[colorlinks=true,citecolor=red]{hyperref}
\usepackage[acronym, toc]{glossaries} % Used to add a wordlist/glossaries
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{color, colortbl}
\usepackage{booktabs}
\usepackage{float}
\usepackage{csquotes}
%zelf toegevoegd
\usepackage[most]{tcolorbox}
\usepackage{multirow} %table
\usepackage{xcolor,colortbl}
\usepackage{pdflscape}
\usepackage{pifont} %%%bullet points
\usepackage{longtable}
\usepackage{graphicx}
%\usepackage{geometry} %table margin
\begin{document}
\begin{longtable}{|l|ccc|ccc|}
\caption{test}
\label{test}\\
\cline{2-7}
\multicolumn{1}{l|}{} & \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{Duration test}} & \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{test(Count)}} \\ \hline
\rowcolor[HTML]{EFEFEF}test(Total) & test & test & test & test & test & test\\\hline
\endfirsthead
\multicolumn{7}{c}{{\bfseries Table \thetable\ continued from previous page}} \\
\cline{2-7}
\multicolumn{1}{l|}{} & \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{Duration test)}} & \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{test(Count)}} \\ \hline
\rowcolor[HTML]{EFEFEF}test(Total) & test & test & test & test & test & test\\\hline
\endhead
%
test & 00:04 & C & D & 1 & F & G \\ \hline
test & 07:21 & C & D & 47 & F & G \\ \hline
test & 00:18 & C & D & 3 & F & G \\ \hline
test & 00:18 & C & D & 3 & F & G \\ \hline
test & 00:40 & C & D & 9 & F & G \\ \hline
test & 01:20 & C & D & 24 & F & G \\ \hline
test & 00:50 & C & D & 7 & F & G \\ \hline
test & 00:16 & C & D & 2 & F & G \\ \hline
test & 00:28 & C & D & 7 & F & G \\ \hline
test & 00:24 & NOB & NOB & 1 & NOB & NOB \\ \hline
test & 01:53 & C & D & 33 & F & G \\ \hline
test & 04:32 & C & D & 63 & F & G \\ \hline
test & 00:05 & C & D & 3 & F & G \\ \hline
test & 13:21 & C & D & 128 & F & G \\ \hline
test & 00:16 & C & D & 4 & F & G \\ \hline
test & 00:25 & C & D & 6 & F & G \\ \hline
test & 10:19 & C & D & 41 & F & G \\ \hline
test & 00:26 & C & D & 10 & F & G \\ \hline
test & 00:07 & C & D & 3 & F & G \\ \hline
test & 00:12 & C & D & 3 & F & G \\ \hline
test & 00:14 & C & D & 2 & F & G \\ \hline
test & NOB & C & D & NOB & F & G \\ \hline
test & 00:04 & C & D & 1 & F & G \\ \hline
test & 07:21 & C & D & 47 & F & G \\ \hline
test & 00:18 & C & D & 3 & F & G \\ \hline
test & 00:18 & C & D & 3 & F & G \\ \hline
test & 00:40 & C & D & 9 & F & G \\ \hline
test & 01:20 & C & D & 24 & F & G \\ \hline
test & 00:50 & C & D & 7 & F & G \\ \hline
test & 00:16 & C & D & 2 & F & G \\ \hline
test & 00:28 & C & D & 7 & F & G \\ \hline
test & 00:24 & NOB & NOB & 1 & NOB & NOB \\ \hline
test & 01:53 & C & D & 33 & F & G \\ \hline
test & 04:32 & C & D & 63 & F & G \\ \hline
test & 00:05 & C & D & 3 & F & G \\ \hline
test & 13:21 & C & D & 128 & F & G \\ \hline
test & 00:16 & C & D & 4 & F & G \\ \hline
test & 00:25 & C & D & 6 & F & G \\ \hline
test & 10:19 & C & D & 41 & F & G \\ \hline
test & 00:26 & C & D & 10 & F & G \\ \hline
test & 00:07 & C & D & 3 & F & G \\ \hline
test & 00:12 & C & D & 3 & F & G \\ \hline
test & 00:14 & C & D & 2 & F & G \\ \hline
test & NOB & C & D & NOB & F & G \\ \hline
test & 00:04 & C & D & 1 & F & G \\ \hline
test & 07:21 & C & D & 47 & F & G \\ \hline
test & 00:18 & C & D & 3 & F & G \\ \hline
test & 00:18 & C & D & 3 & F & G \\ \hline
test & 00:40 & C & D & 9 & F & G \\ \hline
test & 01:20 & C & D & 24 & F & G \\ \hline
test & 00:50 & C & D & 7 & F & G \\ \hline
test & 00:16 & C & D & 2 & F & G \\ \hline
test & 00:28 & C & D & 7 & F & G \\ \hline
test & 00:24 & NOB & NOB & 1 & NOB & NOB \\ \hline
test & 01:53 & C & D & 33 & F & G \\ \hline
test & 04:32 & C & D & 63 & F & G \\ \hline
test & 00:05 & C & D & 3 & F & G \\ \hline
test & 13:21 & C & D & 128 & F & G \\ \hline
test & 00:16 & C & D & 4 & F & G \\ \hline
test & 00:25 & C & D & 6 & F & G \\ \hline
test & 10:19 & C & D & 41 & F & G \\ \hline
test & 00:26 & C & D & 10 & F & G \\ \hline
test & 00:07 & C & D & 3 & F & G \\ \hline
test & 00:12 & C & D & 3 & F & G \\ \hline
test & 00:14 & C & D & 2 & F & G \\ \hline
test & NOB & C & D & NOB & F & G \\ \hline
\textbf{Grand Total} & 43:49 & 43:25 & 48:50
& 401 & 397 & 51 \\\hline
\end{longtable}
\end{document}

Stargazer Latex output too large

The latex output from R stargazer is too large to fit on one page. I cannot find a way to resolve this issue and break the table onto another page.
\begin{longtable}{#{\extracolsep{5pt}}lD{.}{.}{-3} D{.}{.}{-3} D{.}{.}{-3} }
\caption{test caption \label{models3-5} } \\
\\[-1.8ex]\hline
\hline \\[-1.8ex]
& \multicolumn{3}{c}{\textit{Dependent variable:}} \\
\cline{2-4}
\\[-1.8ex] & \multicolumn{3}{c}{Vote decision} \\
& \multicolumn{1}{c}{Model 3} & \multicolumn{1}{c}{Model 4} & \multicolumn{1}{c}{Model 5} \\
\\[-1.8ex] & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)}\\
\hline \\[-1.8ex]
Intercept & -15.633^{***} & -37.105^{***} & -45.338^{***} \\
& (5.889) & (9.130) & (9.962) \\
& & & \\
male & 16.627^{***} & 11.990^{*} & 8.896 \\
& (5.579) & (6.139) & (6.512) \\
& & & \\
birthyear & 0.008^{***} & 0.018^{***} & 0.023^{***} \\
& (0.003) & (0.005) & (0.005) \\
& & & \\
educ; Secondary II & -24.802^{***} & -24.624^{***} & -25.044^{***} \\
& (5.819) & (6.387) & (6.742) \\
& & & \\
educ; Tertiary & 44.767 & 21.210 & 36.447 \\
& (37.172) & (41.749) & (44.626) \\
& & & \\
household keeper & 23.563 & 16.935 & 1.766 \\
& (17.330) & (19.602) & (20.231) \\
& & & \\
children & 53.961^{***} & 71.322^{***} & 71.402^{***} \\
& (16.251) & (17.778) & (18.504) \\
& & & \\
church attendance & 7.966 & 7.216 & 5.639 \\
& (5.703) & (6.295) & (6.637) \\
& & & \\
taxes & & 26.108^{***} & 30.114^{***} \\
& & (7.412) & (7.876) \\
& & & \\
social expenditure & & -4.277 & -9.684 \\
& & (7.544) & (7.940) \\
& & & \\
chances for foreigners & & & 18.598^{***} \\
& & & (7.095) \\
& & & \\
materialism & & & 19.972^{**} \\
& & & (9.885) \\
& & & \\
male:birthyear & -0.009^{***} & -0.006^{**} & -0.005 \\
& (0.003) & (0.003) & (0.003) \\
& & & \\
birthyear:educ; Secondary II & 0.013^{***} & 0.013^{***} & 0.013^{***} \\
& (0.003) & (0.003) & (0.003) \\
& & & \\
birthyear:educ; Tertiary & -0.023 & -0.011 & -0.019 \\
& (0.019) & (0.021) & (0.023) \\
& & & \\
birthyear:household keeper & -0.012 & -0.009 & -0.001 \\
& (0.009) & (0.010) & (0.010) \\
& & & \\
birthyear:children & -0.027^{***} & -0.036^{***} & -0.036^{***} \\
& (0.008) & (0.009) & (0.009) \\
& & & \\
birthyear:church attendance & -0.004 & -0.004 & -0.003 \\
& (0.003) & (0.003) & (0.003) \\
& & & \\
birthyear:taxes & & -0.013^{***} & -0.015^{***} \\
& & (0.004) & (0.004) \\
& & & \\
birthyear:social expenditure & & 0.001 & 0.004 \\
& & (0.004) & (0.004) \\
& & & \\
birthyear:chances for foreigners & & & -0.010^{***} \\
& & & (0.004) \\
& & & \\
birthyear:materialsim & & & -0.011^{**} \\
& & & (0.005) \\
& & & \\
\hline \\[-1.8ex]
Observations & \multicolumn{1}{c}{7,313} & \multicolumn{1}{c}{7,061} & \multicolumn{1}{c}{6,879} \\
Log Likelihood & \multicolumn{1}{c}{-4,578.775} & \multicolumn{1}{c}{-3,873.386} & \multicolumn{1}{c}{-3,558.999} \\
Akaike Inf. Crit. & \multicolumn{1}{c}{9,185.550} & \multicolumn{1}{c}{7,782.772} & \multicolumn{1}{c}{7,161.997} \\
\hline
\hline \\[-1.8ex]
\textit{Note:} & \multicolumn{3}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\
& \multicolumn{3}{r}{Source: Selects postelection survey 2011-2019} \\
\end{longtable}
\end{table}
I tried to solve the issue using the longtable package, however, I still wasn't able to cut the table. Is there another way to do it or how exactly does the stargazer output need to be altered in order to stop overfloating?

How to adjust cell size in latex? this is my code but it looks quite congested. also is there any way to wrap text in top row?

\begin{table}[h!]
\centering
\begin{tabular}{lllccc}
\cline{1-3}
\multicolumn{1}{|l|}{\textbf{Equipment}} &
\multicolumn{1}{l|}{\textbf{Mass in (kg) (wet basis)}} &
\multicolumn{1}{l|}{\textbf{Mass out (kg)}} &
\multirow{2}{*}{\textbf{}} &
\multicolumn{2}{c}{\textbf{}} \\ \cline{1-3}
\multicolumn{1}{|l|}{NG Preheater} &
\multicolumn{1}{l|}{63027.02528} &
\multicolumn{1}{l|}{63027.02528} &
&
\multicolumn{1}{l}{\textbf{}} &
\multicolumn{1}{l}{\textbf{}} \\ \cline{1-3}
\multicolumn{1}{|l|}{Primary Reformer} & \multicolumn{1}{l|}{63027.02528} & \multicolumn{1}{l|}{63027.02528} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{Secondary Reformer} & \multicolumn{1}{l|}{114612.9197} & \multicolumn{1}{l|}{114612.9197} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{HTS} & \multicolumn{1}{l|}{114533.9399} & \multicolumn{1}{l|}{114533.9399} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{LTS} & \multicolumn{1}{l|}{114533.9399} & \multicolumn{1}{l|}{114533.9399} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{CO2 Bulk Absorber} & \multicolumn{1}{l|}{88197.06698} & \multicolumn{1}{l|}{60609.14025} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{CO2 Lean Absorber} & \multicolumn{1}{l|}{60609.14025} & \multicolumn{1}{l|}{48485.42083} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{Methanator} & \multicolumn{1}{l|}{48485.42083} & \multicolumn{1}{l|}{48485.42083} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{Purifier} & \multicolumn{1}{l|}{46964.94183} & \multicolumn{1}{l|}{46964.94183} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{Syngas Converter} & \multicolumn{1}{l|}{80287.85685} & \multicolumn{1}{l|}{80287.85685} & & & \\ \cline{1-3}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & & &
\end{tabular}
\caption{Units involving heat transfer}
\end{table}
I commented three small portions of your code, including one redundant \multirow.
After that, lines 4 and 5 of my code below may help.
\documentclass{article}
\usepackage{multicol}
\begin{document}
\setlength{\tabcolsep}{1em}
\renewcommand{\arraystretch}{1.5}
\begin{table}%[h!]
\centering
\begin{tabular}{lllccc}
\cline{1-3}
\multicolumn{1}{|l|}{\textbf{Equipment}} &
\multicolumn{1}{l|}{\textbf{Mass in (kg) (wet basis)}} &
\multicolumn{1}{l|}{\textbf{Mass out (kg)}} &
%\multirow{2}{*}{\textbf{}}
&
\multicolumn{2}{c}{\textbf{}} \\ \cline{1-3}
\multicolumn{1}{|l|}{NG Preheater} &
\multicolumn{1}{l|}{63027.02528} &
\multicolumn{1}{l|}{63027.02528} &
&
\multicolumn{1}{l}{\textbf{}} &
\multicolumn{1}{l}{\textbf{}} \\ \cline{1-3}
\multicolumn{1}{|l|}{Primary Reformer} & \multicolumn{1}{l|}{63027.02528} & \multicolumn{1}{l|}{63027.02528} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{Secondary Reformer} & \multicolumn{1}{l|}{114612.9197} & \multicolumn{1}{l|}{114612.9197} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{HTS} & \multicolumn{1}{l|}{114533.9399} & \multicolumn{1}{l|}{114533.9399} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{LTS} & \multicolumn{1}{l|}{114533.9399} & \multicolumn{1}{l|}{114533.9399} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{CO2 Bulk Absorber} & \multicolumn{1}{l|}{88197.06698} & \multicolumn{1}{l|}{60609.14025} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{CO2 Lean Absorber} & \multicolumn{1}{l|}{60609.14025} & \multicolumn{1}{l|}{48485.42083} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{Methanator} & \multicolumn{1}{l|}{48485.42083} & \multicolumn{1}{l|}{48485.42083} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{Purifier} & \multicolumn{1}{l|}{46964.94183} & \multicolumn{1}{l|}{46964.94183} & & & \\ \cline{1-3}
\multicolumn{1}{|l|}{Syngas Converter} & \multicolumn{1}{l|}{80287.85685} & \multicolumn{1}{l|}{80287.85685} & & & \\ \cline{1-3}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & & &
\end{tabular}
%\caption{Units involving heat transfer}
\end{table}
\end{document}
This is what it outputs:
Smarter code, without the redundant multirow and multicolumns as in the comment by SamCarter, still with the empty column number four, five and six (although I believe they are unwanted). The caption must be followed by a label to work correctly!
\documentclass{article}
\begin{document}
\setlength{\tabcolsep}{1em}
\renewcommand{\arraystretch}{1.5}
\begin{table}%[h!]
\centering
\begin{tabular}{|l|l|l|ccc}
\cline{1-3}
\textbf{Equipment} & %
\textbf{Mass in (kg) (wet basis)} & %
\textbf{Mass out (kg)} & & & \\ \cline{1-3}
NG Preheater & 63027.02528 & 63027.02528 & & & \\ \cline{1-3}
Primary Reformer & 63027.02528 & 63027.02528 & & & \\ \cline{1-3}
Secondary Reformer & 114612.9197 & 114612.9197 & & & \\ \cline{1-3}
HTS & 114533.9399 & 114533.9399 & & & \\ \cline{1-3}
LTS & 114533.9399 & 114533.9399 & & & \\ \cline{1-3}
CO2 Bulk Absorber & 88197.06698 & 60609.14025 & & & \\ \cline{1-3}
CO2 Lean Absorber & 60609.14025 & 48485.42083 & & & \\ \cline{1-3}
Methanator & 48485.42083 & 48485.42083 & & & \\ \cline{1-3}
Purifier & 46964.94183 & 46964.94183 & & & \\ \cline{1-3}
Syngas Converter & 80287.85685 & 80287.85685 & & & \\ \cline{1-3}
\end{tabular}
\caption{Units involving heat transfer}
\label{any}
\end{table}
\end{document}

how to draw this table

I'm trying to draw the table of the image, but I can not find the way to do it with latex.
\begin{tabular}{|C{1cm}|C{1cm}|C{1cm}|C{1cm}|C{1cm}|C{1cm}|C{1cm}}
\hline
Tipo RA & \multicolumn{2}{c|}{Area [m$^2$]}& \multicolumn{2}{c|}{Volumen Semiesferico truncado} \\
1 &&&&&&\\ \hline
2 &&&&&&\\ \hline
3 &&&&&&\\ \hline
4 &&&&&&\\ \hline
5 &&&&&&\\ \hline
6 &&&&&&\\ \hline
7 &&&&&&\\ \hline
\end{tabular}
I'd suggest using booktabs:
\documentclass{article}
\usepackage{booktabs,siunitx,makecell}
\newcommand{\pz}{\phantom{0}}
\sisetup{
group-minimum-digits = 3
}
\begin{document}
\noindent
\begin{tabular}{ l *{6}{c} }
\toprule
& \multicolumn{4}{c}{Area [$m^2$]} & \\
\cmidrule{2-5}
& \multicolumn{2}{c}{Circular} & \multicolumn{2}{c}{El\'{\i}ptica} &
\multicolumn{2}{c}{\smash{\makecell[cb]{Volumen Semiesf\'erico \\ truncado [$m^3$]}}} \\
\cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7}
Tipo RA & Rango & Promedio & Rango & Promedio & Rango & Promedio \\
\midrule
ALTA & \num{20866}--\num{28983} & \num{24446} & \num{13354}--\num{18549} & \num{15645} & \num{589840}--\num{1201636} & \num{883786} \\
MEDIA & \num{16634}--\num{27254} & \num{20241} & \num{12476}--\num{20440} & \num{15180} & \num{539605}--\num{1131633} & \num{730582} \\
BAJA & \pz\num{3822}--\num{25577} & \num{16097} & \pz\num{3407}--\num{22735} & \num{14307} & \pz\num{75664}--\num{1063784} & \num{647366} \\
\bottomrule
\end{tabular}
\end{document}
In general, there is no need for vertical rules in a tabular, as the columnar display of information supports horizontal separation naturally.
Creating tables directly in LaTeX is not an easy task, I suggest you use tools that allow you to create tables for latex online such as: https://www.tablesgenerator.com/
Please add the following required packages to your document preamble:
\usepackage{multirow,multicol, makecell, booktabs}
\begin{tabular}{*{7}{c}}
\toprule
& \multicolumn{4}{c}{\smash{\makecell[c]{Area [$m^2$]}}}
& \multicolumn{2}{c}{\smash{\makecell[c]{Volumen Semiesférico \\ truncado [$m^3$]}}}\\
\cline{2-5}
& \multicolumn{2}{c}{Circular} & \multicolumn{2}{c}{Eliptica} & \\
\cline{2-7}
Tipo RA & Rango & Promedio & Rango & Promedio & Rango & Promedio \\
\midrule
ALTA & 20866-28983 & 24464 & 20866-28983 & 24464 & 20866-28983 & 24464 \\
MEDIA & 20866-28983 & 24464 & 20866-28983 & 24464 & 20866-28983 & 24464 \\
BAJA & 20866-28983 & 24464 & 20866-28983 & 24464 & 20866-28983 & 24464 \\
\bottomrule
\end{tabular}
Just a no-booktabs sketch, to reproduce your table as similar as possible. Using booktabs is of course recommended for a readability concept that holds everywhere but the first sight on the table would then change very much.
\documentclass{article}
\usepackage{multirow}
\begin{document}
Text
\begin{table}[ht]
{\sffamily%
\begin{tabular}{*{7}{c|}}
% be careful when nesting \multicolumn and \multirow
\cline{2-7}
\multirow{2}{*}{ } & \multicolumn{4}{|c|}{Area [$m^2$]} & \multicolumn{2}{c|}{\multirow{2}{*}{\shortstack[c]{Volumen Semiesf\'erico\\ truncado [$m^3$]}}}\\
\cline{2-5}
& \multicolumn{2}{c|}{Circular} & \multicolumn{2}{c|}{El\'{\i}ptica} & \multicolumn{1}{c}{} & \\
% second part below is standard
\hline
\multicolumn{1}{|c|}{Tipo RA} & Rango & Promedio & Rango & Promedio & Rango & Promedio\\
\hline
\multicolumn{1}{|c|}{ALTA} & 2 - 2 & 3 & 4 - 4 & 5 & 6 - 6 & 7\\
\hline
\multicolumn{1}{|c|}{MEDIA} & 2 - 2 & 3 & 4 - 4 & 5 & 6 - 6 & 7\\
\hline
\multicolumn{1}{|c|}{BAJA} & 2 - 2 & 3 & 4 - 4 & 5 & 6 - 6 & 7\\
\hline
\end{tabular}
}%
\end{table}
Text.
\end{document}
The output of this code is:
Alignments, line breaks and spacing may be considerably improved, also depending on your time and objectives.

How to fit a large table in a landscape format fit an entire page in Latex

I am working on my dissertation and lamentably I have a 17 column table (writing below). I have tried tabular*, tabularx and I have yet to fit this in the whole page.
\begin{sidewaystable}[htp]
\begin{tabular}{l#{\hspace{4pt}}*{17}{c}}
\multicolumn{17}{ c }{Title}\\
\hline
\hline
Organism Family & UniProt (Main) & Interactor & Domains & PDB (Main) & PDB (Interactor) & Complex & IntType & SpeMain & TaxIDMain & BioRoleMain & NamInt & PUBMED (URL)\\
\hline
\multirow{2}{*}{3l6p}& 2.40.10.120 & 1\\
& 2.40.10.10 & 1\\ \hline
1l9k & 3.40.50.150 & 1\\ \hline
\multirow{4}{*}{1oanA/B}& 2.60.98.10 & 3\\
& 3.30.387.10 & 1\\
& 3.30.67.10 & 1\\
& 2.60.40.350 & 1\\ \hline
\multirow{4}{*}{1uzgA/B}& 2.60.98.10 & 3\\
& 3.30.387.10 & 1\\
& 3.30.67.10 & 1\\
& 2.60.40.350 & 1\\ \hline
3we1B & 2.60.40.350 & 2 \\ \hline
\multirow{4}{*}{4cbfA/B}& 2.60.98.10 & 4\\
& 3.30.387.10 & 1\\
& 3.30.67.10 & 1\\
& 2.60.40.350 & 1\\ \hline
4al8L/H & 2.60.40.10 & 2\\
4al8C & 2.60.40.350 & 1\\ \hline
\multirow{2}{*}{2bhrA/B} & 3.40.50.300 & 2\\
& 3.40.50.300 & 2\\ \hline
\multirow{2}{*}{2fomB} & 2.40.10.120 & 1\\
& 2.40.10.10 & 1 \\ \hline
\end{tabular}
\caption{Dengue Domains Modelled}{TThis Table shows the domains modelled for each of the selected Dengue proteins. It also includes the number of domain repetitions in each protein structure.}
\label{Sample Data}
\end{sidewaystable}
The end result is shown in the image bellow.
Could please someone enlighten me on how to force the table to be within the page?
Also, the "Title" does not appear in the center of the table.
I have managed to control the length of one of the 17 columns by using the following modifications.
\begin{sidewaystable}[htp]
\begin{tabularx}{\textwidth}{l#{\hspace{4pt}}*{17}{c}}\\
\multicolumn{17}{>{\centering\setlength\hsize{1\hsize} }X}{Title}\\
\hline
\hline
\multicolumn{1}{>{\centering\setlength\hsize{0.07\hsize} }X|}{Organism Family} & \multicolumn{1}{>{\centering\setlength\hsize{0.02\hsize} }X|}{UniProtM} & \multicolumn{1}{>{\centering\setlength\hsize{0.07\hsize} }X|}{UniProtI} & \multicolumn{1}{>{\centering\setlength\hsize{0.06\hsize} }X|}{Domains}
& \multicolumn{1}{>{\centering\setlength\hsize{0.04\hsize} }X|}{pdbM}
& \multicolumn{1}{>{\centering\setlength\hsize{0.04\hsize} }X|}{PDBI}
& \multicolumn{1}{>{\centering\setlength\hsize{0.06\hsize} }X|}{Complex}
& \multicolumn{1}{>{\centering\setlength\hsize{0.06\hsize} }X|}{IntType}
& SpeM & TaxIDM & BioRoleM & NamI & PUBMED\\
\hline
\multirow{2}{*}{3l6p}& 2.40.10.120 & 1\\
& 2.40.10.10 & 1\\ \hline
1l9k & 3.40.50.150 & 1\\ \hline
\multirow{4}{*}{1oanA/B}& 2.60.98.10 & 3\\
& 3.30.387.10 & 1\\
& 3.30.67.10 & 1\\
& 2.60.40.350 & 1\\ \hline
\multirow{4}{*}{1uzgA/B}& 2.60.98.10 & 3\\
& 3.30.387.10 & 1\\
& 3.30.67.10 & 1\\
& 2.60.40.350 & 1\\ \hline
3we1B & 2.60.40.350 & 2 \\ \hline
\multirow{4}{*}{4cbfA/B}& 2.60.98.10 & 4\\
& 3.30.387.10 & 1\\
& 3.30.67.10 & 1\\
& 2.60.40.350 & 1\\ \hline
4al8L/H & 2.60.40.10 & 2\\
4al8C & 2.60.40.350 & 1\\ \hline
\multirow{2}{*}{2bhrA/B} & 3.40.50.300 & 2\\
& 3.40.50.300 & 2\\ \hline
\multirow{2}{*}{2fomB} & 2.40.10.120 & 1\\
& 2.40.10.10 & 1 \\ \hline
\end{tabularx}
\caption{Dengue Domains Modelled}{TThis Table shows the domains modelled for each of the selected Dengue proteins. It also includes the number of domain repetitions in each protein structure.}
\label{Sample Data}
\end{sidewaystable}
I used \multicolumn{1}{>{\centering\setlength\hsize{0.07\hsize} }X|}{Column Name} This allow me to control the specific size in each part of it.
I will keep working on how to control each one of the inputs inside the table.
I can't test it right now, but I believe putting your table into a minpage environment would help here.

Resources