latex-side by side tables

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u010643777/article/details/88362343

using minipage

% Please add the following required packages to your document preamble:
% \usepackage{multirow}
\begin{table*}
\begin{minipage}[t]{0.5\linewidth}
\caption{example1}
\label{Tab:example1}
\centering
\scalebox{1}{
\begin{tabular}{|c|c|c|c|c|}
\hline
\multirow{2}{*}{}   & 1      & 2      & 3    & 4    \\ \cline{2-5} 
                    & \multicolumn{4}{c|}{(v1, v2)} \\ \hline
\multirow{5}{*}{E1} & (1, 2) & (1, 2) & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\multirow{5}{*}{E2} & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\multirow{5}{*}{E3} & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\multirow{5}{*}{E4} & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\end{tabular}}
\end{minipage}
\hfill
\begin{minipage}[t]{0.5\linewidth}
\caption{example2}
\label{Tab:example2}
\centering
\scalebox{1}{
\begin{tabular}{|c|c|c|c|c|}
\hline
\multirow{2}{*}{}   & 1      & 2      & 3    & 4    \\ \cline{2-5} 
                    & \multicolumn{4}{c|}{(v1, v2)} \\ \hline
\multirow{5}{*}{E1} & (1, 2) & (1, 2) & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\multirow{5}{*}{E2} & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\multirow{5}{*}{E3} & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\multirow{5}{*}{E4} & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\end{tabular}}
\end{minipage}
\end{table*}

 Final result:
在这里插入图片描述

using subtable

% Please add the following required packages to your document preamble:
% \usepackage{multirow}
\begin{table*}
\caption{Title}
\begin{subtable}[t]{.5\textwidth}
\caption{example1}
\raggedright
\label{Tab:example1}
\centering
\scalebox{1}{
\begin{tabular}{|c|c|c|c|c|}
\hline
\multirow{2}{*}{}   & 1      & 2      & 3    & 4    \\ \cline{2-5} 
                    & \multicolumn{4}{c|}{(v1, v2)} \\ \hline
\multirow{5}{*}{E1} & (1, 2) & (1, 2) & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\multirow{5}{*}{E2} & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\multirow{5}{*}{E3} & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\multirow{5}{*}{E4} & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\end{tabular}}
\end{subtable}%
\begin{subtable}[t]{.5\textwidth}
\raggedleft
\caption{example2}
\label{Tab:example2}
\centering
\scalebox{1}{
\begin{tabular}{|c|c|c|c|c|}
\hline
\multirow{2}{*}{}   & 1      & 2      & 3    & 4    \\ \cline{2-5} 
                    & \multicolumn{4}{c|}{(v1, v2)} \\ \hline
\multirow{5}{*}{E1} & (1, 2) & (1, 2) & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2) & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\multirow{5}{*}{E2} & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\multirow{5}{*}{E3} & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\multirow{5}{*}{E4} & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \cline{2-5} 
                    & (1, 2)   & (1, 2)   & (1, 2) & (1, 2) \\ \hline
\end{tabular}}
\end{subtable}
\end{table*}

 Final result:
在这里插入图片描述

[1] create larex table online https://www.tablesgenerator.com/
[2] LaTax minipage http://www.sascha-frank.com/latex-minipage.html

猜你喜欢

转载自blog.csdn.net/u010643777/article/details/88362343
今日推荐