[Tex/LaTex] How to arrange mdframed side by side

mdframedpositioning

How to arrange mdframed side by side, like

mdframed1 mdframe2

\begin{mdframed}[roundcorner=10pt]
 table 1
\end{mdframed}
\leavevmode
\hspace{2cm}
\begin{mdframed}[roundcorner=10pt]
 table 2
\end{mdframed}

Best Answer

Placing each mdframed environment inside a minipage of specific width works:

\documentclass{article}
\usepackage{mdframed}% http://ctan.org/pkg/mdframed
\begin{document}
\noindent
\null\hfill%
\begin{minipage}{.4\linewidth}
  \begin{mdframed}[roundcorner=10pt]
    table 1
  \end{mdframed}
\end{minipage}
\hspace{2cm}
\begin{minipage}{.4\linewidth}
  \begin{mdframed}[roundcorner=10pt]
    table 2
  \end{mdframed}
\end{minipage}%
\hfill\null
\end{document}

Change .4\linewidth to your liking. The use of \null\hfill ... \hfill\null is to centre the mdframes within the text block without having to wrap it inside a group. \centering with a group would also work.

Related Question