13

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}
10

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.

  • Great it works. – manish Apr 3 '12 at 1:51
  • 5
    @Werner: as far as I tested, your solution does not manage correctly a mdframe spanning over multiple pages. I guess that the initial reason to use a mdframe would be to support multi-pages. I did not find any solution yet. – user25100 Jan 28 '13 at 0:47

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.