Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to use 'minipage' to put all 4 tables on the same row line. But, it does not work. I only can put small tables on the same row line. How can I solve it.

share|improve this question
1  
You don't need to use a minipage for that. Just put the tables next to each other without a blank line in between. –  Peter Grill May 6 at 5:40

1 Answer 1

The following may do what you're looking to achieve. Note the use of \hfill in the three gaps between the tables; it ensures that the four tables take up the full width of the text block.

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage[hmargin=2.5cm]{geometry}  % choose page margins here
\usepackage{booktabs} % for \toprule, \midrule, and \bottomrule macros

\newcommand\maketabular{%  %% macro for a repeated element
\begin{tabular}{lrrr}
\toprule
A & B & C & D \\
\midrule
15 & 20 & 30 & 40 \\
30 & 40 & 60 & 80 \\
\bottomrule
\end{tabular}} % end of \maketabular macro

\begin{document}
\begin{table}[h!]  % "[h!]" placement directive just for this example
\caption{Four side-by-side tables}
% increase the vertical separation between caption and tabular material
\medskip 

\maketabular
\hfill % for maximal horizonal separation between the tabular environments
\maketabular
\hfill
\maketabular
\hfill
\maketabular
\end{table}
\end{document}
share|improve this answer
    
Thank you to all. –  user46377 May 7 at 0:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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