1

I am trying to arrange a report using tabular environment. Here is my MWE.

\documentclass[11pt,letterpaper,twoside,english,final]{article} 


\usepackage{rotating}
\usepackage{multirow}
\usepackage{graphicx}

\begin{document} 


\section{Experimental Results}


%\begin{sidewaystable}[p]
\begin{table}[htpb]
\begin{tabular}{@{}c@{}@{}c@{}@{}c@{}@{}c@{}}
\includegraphics[width=0.125\textwidth]{example-grid-100x100pt}            & \includegraphics[width=0.125\textwidth]{example-grid-100x100pt}          & \multirow{4}{*}{\includegraphics[height=2.25in]{example-grid-100x100pt}} & \multirow{4}{*}{\includegraphics[height=2.25in]{example-grid-100x100pt}}      \\ 
i           & ii        &                   &                   \\
\includegraphics[width=0.125\textwidth]{example-grid-100x100pt}            & \includegraphics[width=0.125\textwidth]{example-grid-100x100pt}          &                   &                   \\ 
iii         & iv        &                   &                   \\
\multicolumn{2}{c}{\vspace{6pt}Pictures } & \vspace{6pt}Speedup                & \vspace{6pt}Histograms                 \\
\multicolumn{2}{c}{}  &                   &                   \\ 
\multicolumn{2}{c}{
\resizebox{0.3\textwidth}{!}{%
\begin{tabular}{ccccccc}
\multicolumn{1}{l}{}                                  &                                    & \multicolumn{5}{c}{Cat 1}                                                                                                                                                      \\ \cline{3-7} 
\multicolumn{1}{l}{}                                  & \multicolumn{1}{l|}{}              & \multicolumn{1}{l|}{\textbf{256}} & \multicolumn{1}{l|}{\textbf{512}} & \multicolumn{1}{l|}{\textbf{1024}} & \multicolumn{1}{l|}{\textbf{2048}} & \multicolumn{1}{l|}{\textbf{4096}} \\ \cline{2-7} 
\multicolumn{1}{c|}{\multirow{6}{*}{\begin{sideways}Cat 2\end{sideways}}} & \multicolumn{1}{l|}{\textbf{64}}   & \multicolumn{1}{l|}{5.04}         & \multicolumn{1}{l|}{25.90}        & \multicolumn{1}{l|}{125.00}        & \multicolumn{1}{l|}{509.20}        & \multicolumn{1}{l|}{2,127.00}      \\ \cline{2-7} 
\multicolumn{1}{c|}{}                                 & \multicolumn{1}{l|}{\textbf{128}}  & \multicolumn{1}{l|}{2.36}         & \multicolumn{1}{l|}{20.25}        & \multicolumn{1}{l|}{115.10}        & \multicolumn{1}{l|}{502.60}        & \multicolumn{1}{l|}{2,183.00}      \\ \cline{2-7} 
\multicolumn{1}{c|}{}                                 & \multicolumn{1}{l|}{\textbf{256}}  & \multicolumn{1}{l|}{}             & \multicolumn{1}{l|}{10.31}        & \multicolumn{1}{l|}{95.69}         & \multicolumn{1}{l|}{512.60}        & \multicolumn{1}{l|}{2,382.88}      \\ \cline{2-2} \cline{4-7} 
\multicolumn{1}{c|}{}                                 & \multicolumn{1}{l|}{\textbf{512}}  &                                   & \multicolumn{1}{l|}{}             & \multicolumn{1}{l|}{59.85}         & \multicolumn{1}{l|}{538.60}        & \multicolumn{1}{l|}{2,895.90}      \\ \cline{2-2} \cline{5-7} 
\multicolumn{1}{c|}{}                                 & \multicolumn{1}{l|}{\textbf{1024}} &                                   &                                   & \multicolumn{1}{l|}{}              & \multicolumn{1}{l|}{568.10}        & \multicolumn{1}{l|}{5,225.46}      \\ \cline{2-2} \cline{6-7} 
\multicolumn{1}{c|}{}                                 & \multicolumn{1}{l|}{\textbf{2048}} &                                   &                                   &                                    & \multicolumn{1}{l|}{}              & \multicolumn{1}{l|}{9,104.83}      \\ \cline{2-2} \cline{7-7} 
\end{tabular}
}
} & 
\resizebox{0.3\textwidth}{!}{%
\begin{tabular}{ccccccc}
\multicolumn{1}{l}{}                                  &                                    & \multicolumn{5}{c}{Cat 1}                                                                                                                                                      \\ \cline{3-7} 
\multicolumn{1}{l}{}                                  & \multicolumn{1}{l|}{}              & \multicolumn{1}{l|}{\textbf{256}} & \multicolumn{1}{l|}{\textbf{512}} & \multicolumn{1}{l|}{\textbf{1024}} & \multicolumn{1}{l|}{\textbf{2048}} & \multicolumn{1}{l|}{\textbf{4096}} \\ \cline{2-7} 
\multicolumn{1}{c|}{\multirow{6}{*}{\begin{sideways}Cat 2\end{sideways}}} & \multicolumn{1}{l|}{\textbf{64}}   & \multicolumn{1}{l|}{5.04}         & \multicolumn{1}{l|}{25.90}        & \multicolumn{1}{l|}{125.00}        & \multicolumn{1}{l|}{509.20}        & \multicolumn{1}{l|}{2,127.00}      \\ \cline{2-7} 
\multicolumn{1}{c|}{}                                 & \multicolumn{1}{l|}{\textbf{128}}  & \multicolumn{1}{l|}{2.36}         & \multicolumn{1}{l|}{20.25}        & \multicolumn{1}{l|}{115.10}        & \multicolumn{1}{l|}{502.60}        & \multicolumn{1}{l|}{2,183.00}      \\ \cline{2-7} 
\multicolumn{1}{c|}{}                                 & \multicolumn{1}{l|}{\textbf{256}}  & \multicolumn{1}{l|}{}             & \multicolumn{1}{l|}{10.31}        & \multicolumn{1}{l|}{95.69}         & \multicolumn{1}{l|}{512.60}        & \multicolumn{1}{l|}{2,382.88}      \\ \cline{2-2} \cline{4-7} 
\multicolumn{1}{c|}{}                                 & \multicolumn{1}{l|}{\textbf{512}}  &                                   & \multicolumn{1}{l|}{}             & \multicolumn{1}{l|}{59.85}         & \multicolumn{1}{l|}{538.60}        & \multicolumn{1}{l|}{2,895.90}      \\ \cline{2-2} \cline{5-7} 
\multicolumn{1}{c|}{}                                 & \multicolumn{1}{l|}{\textbf{1024}} &                                   &                                   & \multicolumn{1}{l|}{}              & \multicolumn{1}{l|}{568.10}        & \multicolumn{1}{l|}{5,225.46}      \\ \cline{2-2} \cline{6-7} 
\multicolumn{1}{c|}{}                                 & \multicolumn{1}{l|}{\textbf{2048}} &                                   &                                   &                                    & \multicolumn{1}{l|}{}              & \multicolumn{1}{l|}{9,104.83}      \\ \cline{2-2} \cline{7-7} 
\end{tabular}
}
&
\includegraphics[height=1in]{example-image}
\\
\multicolumn{2}{c}{Runtime 1}  & Runtime 2                 &                                   
\end{tabular}
%\end{sidewaystable}
\end{table}


\end{document}

Here is the output produced:

enter image description here

Now I am trying to figure out several things.

  1. How can I align the First row such that the Speedup and Histograms are aligned top with the four small pictures.

  2. The Image file in the second row should be aligned with the two Runtime tables.

Thanks

  • You can put a tabular inside a tabular (easier than multirow). – John Kormylo Feb 24 '17 at 0:46
1

I made some essentially gratuitous changes regarding the runtime tabulars, if only to make the code more readable (to me).

\documentclass[11pt,letterpaper,twoside,english,final]{article} 

%\usepackage{rotating}
\usepackage{multirow}
\usepackage{graphicx}

\begin{document} 

\section{Experimental Results}

%\begin{sidewaystable}[p]
\begin{table}[htpb]
\begin{tabular}{@{}c@{}@{}c@{}@{}c@{}@{}}
% start of 2x2 picture group
\raisebox{-\height}{\begin{tabular}{@{}c@{}@{}c@{}@{}}%
\includegraphics[width=0.125\textwidth]{example-grid-100x100pt} & \includegraphics[width=0.125\textwidth]{example-grid-100x100pt} \\
i & ii \\
\includegraphics[width=0.125\textwidth]{example-grid-100x100pt} & \includegraphics[width=0.125\textwidth]{example-grid-100x100pt} \\ 
iii & iv  
\end{tabular}}% end of 2x2 picture group
 & \raisebox{-\height}{\includegraphics[height=2.25in]{example-grid-100x100pt}}
 & \raisebox{-\height}{\includegraphics[height=2.25in]{example-grid-100x100pt}} \\[6pt]
Pictures & Speedup & Histograms \\
% start of runtime 1
\raisebox{-\height}{\resizebox{0.3\textwidth}{!}{%
\begin{tabular}{@{}c|l|l|l|l|l|l|l|}
 \multicolumn{2}{c}{}  & \multicolumn{5}{c}{Cat 1} \\
 \cline{3-7}
 \multicolumn{2}{c|}{} & \textbf{256} & \textbf{512} & \textbf{1024} & \textbf{2048} & \textbf{4096} \\
 \cline{2-7}
 \multirow{6}{*}{\rotatebox[origin=c]{90}{Cat 2}}
 & \textbf{64} & 5.04 & 25.90 & 125.00 & 509.20 & 2,127.00 \\
 \cline{2-7}
 & \textbf{128} & 2.36 & 20.25 & 115.10 & 502.60 & 2,183.00 \\
 \cline{2-7}
 & \textbf{256} &  & 10.31 & 95.69 & 512.60 & 2,382.88  \\
 \cline{2-2} \cline{4-7} 
 & \textbf{512} & \multicolumn{2}{|c|}{} & 59.85 & 538.60 & 2,895.90 \\
 \cline{2-2} \cline{5-7}
 & \textbf{1024} & \multicolumn{3}{|c|}{} & 568.10 & 5,225.46 \\
 \cline{2-2} \cline{6-7} 
 & \textbf{2048} & \multicolumn{4}{|c|}{} & 9,104.83 \\
 \cline{2-2} \cline{7-7} 
\end{tabular}}} &
%start of runtime 2
\raisebox{-\height}{\resizebox{0.3\textwidth}{!}{%
\begin{tabular}{@{}c|l|l|l|l|l|l|l|}
 \multicolumn{2}{c}{}  & \multicolumn{5}{c}{Cat 1} \\
 \cline{3-7}
 \multicolumn{2}{c|}{} & \textbf{256} & \textbf{512} & \textbf{1024} & \textbf{2048} & \textbf{4096} \\
 \cline{2-7}
 \multirow{6}{*}{\rotatebox[origin=c]{90}{Cat 2}}
 & \textbf{64} & 5.04 & 25.90 & 125.00 & 509.20 & 2,127.00 \\
 \cline{2-7}
 & \textbf{128} & 2.36 & 20.25 & 115.10 & 502.60 & 2,183.00 \\
 \cline{2-7}
 & \textbf{256} &  & 10.31 & 95.69 & 512.60 & 2,382.88  \\
 \cline{2-2} \cline{4-7} 
 & \textbf{512} & \multicolumn{2}{|c|}{} & 59.85 & 538.60 & 2,895.90 \\
 \cline{2-2} \cline{5-7}
 & \textbf{1024} & \multicolumn{3}{|c|}{} & 568.10 & 5,225.46 \\
 \cline{2-2} \cline{6-7} 
 & \textbf{2048} & \multicolumn{4}{|c|}{} & 9,104.83 \\
 \cline{2-2} \cline{7-7} 
\end{tabular}}} &
\raisebox{-\height}{\includegraphics[height=1in]{example-image}} \\
Runtime 1 & Runtime 2
\end{tabular}
\end{table}

%\end{sidewaystable}

\end{document}

demo

  • Actually, you are too wide for the page. It looks a lot better in a sideways table. – John Kormylo Feb 24 '17 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.