This is similar to Gonzalo's answer, but has the advantage of not requiring explicit computations nor strange adjustments.
\documentclass{article}
\usepackage[demo]{graphicx} % for inclusion of graphics
\usepackage{booktabs}
\usepackage{capt-of,calc}
\newsavebox{\figurebox}
\begin{document}
\begin{figure}[t]
%% get the dimensions of the figure
\sbox{\figurebox}{\includegraphics[height=8cm]{Images/preNet.pdf}}
\begin{minipage}[t][\ht\figurebox]{\textwidth-\wd\figurebox-1em}
\centering\footnotesize
\vspace*{0pt}% to set the top
\begin{tabular}{ccc} \toprule
Heading 1 & Heading 2 & Heading 3 \\ \midrule
1 & $\{1\}$ & A \\
2 & $\{1,2\}$ & B \\
3 & $\{1,2,3\}$ & C \\
4 & $\{1,2,3,4\}$ & D \\
5 & $\{1,2,3,4,5\}$ & E \\
6 & $\{1,2,3,4,5,6\}$ & F \\
7 & $\{1,2,3,4,5,6,7\}$ & G \\ \bottomrule
\end{tabular}
\captionof{table}{A caption for a table in a figure and a table side by side}
\label{tab:test}
\vfill
\captionof{figure}{A caption for a figure in a figure and a table side by side}
\label{fig:test}
\end{minipage}\hfill
\begin{minipage}[t]{\wd\figurebox}
\centering
\vspace*{0pt}% to set the top
\usebox{\figurebox}
\end{minipage}
\end{figure}
\end{document}
Instead of capt-of
one can load caption
that has other advantages; however, some classes don't allow using caption
.

You can place each mdframed
inside a minipage
of the desired width (in this way, you can place sevearl mdframes
side-by-side); inside each mdframed
you can use a \parbox
(or another minipage
) of the predefined height. In the example below I implement this idea using a command with a mandatory argument (for the contents of the mdframed
) and an optional argument to pass options to mdframed
, but of course, you can implement the idea in any other way that suits your needs:
\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}
\newcommand\FixedHt[2][]{%
\begin{minipage}[t]{.30\textwidth}
\begin{mdframed}[roundcorner=5pt,#1]
\parbox[t][8cm][t]{\linewidth}{#2}
\end{mdframed}%
\end{minipage}%
}
\begin{document}
\noindent\FixedHt[backgroundcolor=cyan!20]{Some text}\hfill\FixedHt[backgroundcolor=orange!20]{Some text}\hfill\FixedHt[backgroundcolor=green!20]{Some text}\par
\end{document}

Best Answer
Placing each
mdframed
environment inside aminipage
of specific width works:Change
.4\linewidth
to your liking. The use of\null\hfill
...\hfill\null
is to centre themdframe
s within the text block without having to wrap it inside a group.\centering
with a group would also work.