# Set minipage width to the available space

I am trying to fit 2 minipages next to each other, and I would like one to take 20% of the \textwidth, and the other one the rest of the space available, with a margin between both minipages that I could set. I am using the code below. Note that I also tried with fixed values for the width of the minipages and I still have the problem I will describe below.

 \documentclass[a4paper, 10pt]{report}
\begin{document}
\begin{table}[!htb]
\begin{minipage}[t]{0.3\textwidth}
\begin{tabular}{l}
Content
\end{tabular}
\end{minipage}%
\begin{minipage}[t]{0.7\textwidth}
\begin{tabular}{lll}
Content
\end{tabular}
\end{minipage}%
\end{table}
\end{document}


With this code, there is a huge margin between the two minipages, and the right minipage does not take the available space. How can I set this space, and force my minipage to fill the available space ?

• The minipage is .7\textwidth wide which is exactly the available space, your problem is not the minipage width but the fact that the content of the minipage is not as wide as the minipage. You can have a minipage that is \textwidth wide but if it just contains x then it will visually look like white space. – David Carlisle Dec 19 '14 at 12:33

Please always post complete documents not fragments, so this is untested, but putting a longtable in a minipage removes all the features of longtable and using longtable instead of tabular removes all the features of tabular, in particular tabular are naturally the width of their content.
 \begin{table}[!htb]