[Tex/LaTex] Placing three tables next to each other

pdftextables

I am trying to place three tables next to each other. Because they have the same caption, they are placed in three tabular envs in the same table env. For positioning I use minipage.

This works fairly well, but when looking closely, the gaps between tables 1/2 and 2/3 are not exactly the same width. This looks annoying with longer tables. Any ideas about how to get those gaps exactly the same width? The overall table should stay centered.

I actually use this in a large document with lots of packages loaded, but the behaviour seems to be the same in this MWE.

\documentclass{scrartcl}        
\begin{document}        
        \begin{table}
            \footnotesize
                \begin{minipage}{0.33\textwidth}
                \raggedright
                \begin{tabular}{|p{3.2cm}|c|}
                    \hline
                    bla&1\\ \hline
                    blubb&2 \\ \hline
                    bla&1\\ \hline
                    blubb&2 \\ \hline   
                    bla&1\\ \hline
                    blubb&2 \\ \hline   
                \end{tabular}
                \end{minipage}
                \begin{minipage}[c]{0.33\textwidth}
                %\centering
                \begin{tabular}{|p{3.2cm}|c|}
                    \hline
                    bla&1\\ \hline
                    blubb&2 \\ \hline
                    bla&1\\ \hline
                    blubb&2 \\ \hline   
                    bla&1\\ \hline
                    blubb&2 \\ \hline   
                \end{tabular}
                \end{minipage}%
                \begin{minipage}[c]{0.33\textwidth}
                %\raggedleft
                \begin{tabular}{|p{3.2cm}|c|}
                    \hline
                    bla&1\\ \hline
                    blubb&2 \\ \hline
                    bla&1\\ \hline
                    blubb&2 \\ \hline   
                    bla&1\\ \hline
                    blubb&2 \\ \hline   
                \end{tabular}
                \end{minipage}
                \caption{99 most frequent hashtags in the data set.}
            \end{table}
\end{document}

Best Answer

enter image description here

No need for minipages, \raggedright or any extra stuff. Just tabulars and \hfill between any two of them. The placement option [t] also aligns the tables' headers.

\documentclass{scrartcl}        
\begin{document}        
        \begin{table}
            \footnotesize
                \begin{tabular}[t]{|p{3.2cm}|c|}
                    \hline
                    bla&1\\ \hline
                    blubb&2 \\ \hline
                    bla&1\\ \hline
                    blubb&2 \\ \hline   
                    bla&1\\ \hline
                    blubb&2 \\ \hline   
                \end{tabular}
                \hfill
                \begin{tabular}[t]{|p{3.2cm}|c|}
                    \hline
                    bla&1\\ \hline
                    blubb&2 \\ \hline
                    bla&1\\ \hline
                    blubb&2 \\ \hline   
                    bla&1\\ \hline
                    blubb&2 \\ \hline   
                \end{tabular}
                \hfill
                \begin{tabular}[t]{|p{3.2cm}|c|}
                    \hline
                    bla&1\\ \hline
                    blubb&2 \\ \hline
                    bla&1\\ \hline
                    blubb&2 \\ \hline   
                    bla&1\\ \hline
                    blubb&2 \\ \hline   
                \end{tabular}
                \caption{99 most frequent hashtags in the data set.}
            \end{table}
\end{document}
Related Question