2

I have the following tables and want to put them side by side.

 \documentclass[slovene,a4paper,12pt]{article}


 \usepackage{geometry}
 \geometry{
 a4paper,
 left=30mm,
 right=25mm,
 top=20mm,
 bottom=29mm
 }

\setlength\arrayrulewidth{1.2pt}
\makeatletter
\def\hlinewd#1{%
\noalign{\ifnum0=`}\fi\hrule \@height #1 \futurelet
\reserved@a\@xhline}










\begin{document}


\begin{table}[h]
%\centering
\small
\begin{tabular}{|c|c|}\hline
$R\left[cm\right]$&$V_{max}\left[\frac{m}{s}\right]$ \\ \hline
$1,0$&$0.95$\\ \hlinewd{.5pt}
$3,0$&$1.03$\\ \hlinewd{.5pt}
$5,0$&$0.89$\\ \hlinewd{.5pt}
$7,0$&$1.04$\\ \hline
\end{tabular}
\end{table}

\begin{table}[h]
%\centering
\small
\begin{tabular}{|c|c|}\hline
$\rho_p\left[\frac{g}{m^2}\right]$&$V_{max}\left[\frac{m}{s}\right]$ \\ \hline
$75$&$0.89$\\ \hlinewd{.5pt}
$80$&$0.95$\\ \hlinewd{.5pt}
$90$&$1.07$\\ \hlinewd{.5pt}
$100$&$1.09$\\ \hlinewd{.5pt}
$160$&$1.47$\\ \hlinewd{.5pt}
$170$&$1.42$\\ \hlinewd{.5pt}
$200$&$1.64$\\ \hlinewd{.5pt}
$250$&$1.70$\\ \hline
\end{tabular}
\end{table}



\begin{table}[h]
%\centering
\small
\begin{tabular}{|c|c|}\hline
$\alpha$&$V_{max}\left[\frac{m}{s}\right]$ \\ \hline
$30^{\circ}$&$1.43$\\ \hlinewd{.5pt}
$40^{\circ}$&$1.02$\\ \hlinewd{.5pt}
$50^{\circ}$&$0.91$\\ \hlinewd{.5pt}
$60^{\circ}$&$0.77$\\ \hline
\end{tabular}
\end{table}



\begin{table}[h]
%\centering
\small
\begin{tabular}{|c|c|}\hline
$n$&$V_{max}\left[\frac{m}{s}\right]$ \\ \hline
$3$&$0.90$\\ \hlinewd{.5pt}
$4$&$1.02$\\ \hlinewd{.5pt}
$5$&$1.03$\\ \hlinewd{.5pt}
$6$&$0.97$\\ \hlinewd{.5pt}
$7$&$0.96$\\ \hlinewd{.5pt}
$8$&$0.95$\\ \hlinewd{.5pt}
$9$&$1.03$\\ \hlinewd{.5pt}
$10$&$1.03$\\ \hline
\end{tabular}
\end{table}


\end{document}

I tried many instructions such as placing all tables inside the tabular. They all only worked for tabulars and not for tables.

How can I make it work for those tables?

1
  • tabular are set by the same rules as letters, they go side-by-side by default, put them on one line in the same table Commented Mar 11, 2021 at 19:56

1 Answer 1

0

As noted @DavidCarlisle in his comment, just collect all tabulars in one table. I took liberty and make some changes in your code:

  • for units is now employed package siunitx
  • for thick hline is are used \Xhline{1.2pt} from the makecell package
  • for thick vertical lines are used !{\vline width 1.2pt}
\documentclass[slovene,12pt]{article}
\usepackage[hmargin={30mm,25mm},
            vmargin={20mm,29mm}
           ]{geometry}
\usepackage{siunitx}
\usepackage{array, makecell}

\begin{document}
    \begin{table}[ht]
\small
\begin{tabular}[t]{!{\vline width 1.2pt} c|c!{\vline width 1.2pt}}
    \Xhline{1.2pt}
$R [\si{cm}]$
    &$V_{\max} [\si{\metre\per\second}]$  \\ 
    \Xhline{1.2pt}
1,0 &   0.95    \\ \hline
3,0 &   1.03    \\ \hline
5,0 &   0.89    \\ \hline
7,0 &   1.04    \\ 
    \Xhline{1.2pt}
\end{tabular}
\hfill%
\begin{tabular}[t]{!{\vline width 1.2pt}c|c!{\vline width 1.2pt}}
    \Xhline{1.2pt}
$\rho_p [\si{\gram\per\square\metre}]$
    &   $V_{\max}$ [\si{\metre\per\second}] \\ 
    \Xhline{1.2pt}    
75  &   0.89    \\ \hline
80  &   0.95    \\ \hline
90  &   1.07    \\ \hline
100 &   1.09    \\ \hline
160 &   1.47    \\ \hline
170 &   1.42    \\ \hline
200 &   1.64    \\ \hline
250 &   1.70    \\ 
    \Xhline{1.2pt}
\end{tabular}%
\hfill%
\begin{tabular}[t]{!{\vline width 1.2pt}c<{\si{\degree}}|c!{\vline width 1.2pt}}
    \Xhline{1.2pt}
\multicolumn{1}{!{\vline width 1.2pt}c|}{$\alpha$}
    &   $V_{\max}$ [\si{\metre\per\second}] \\ 
    \Xhline{1.2pt}
30  &   1.43    \\ \hline
40  &   1.02    \\ \hline
50  &   0.91    \\ \hline
60  &   0.77    \\ 
    \Xhline{1.2pt}
\end{tabular}%
\hfill
\begin{tabular}[t]{!{\vline width 1.2pt}c|c!{\vline width 1.2pt}}
    \Xhline{1.2pt}
n   &   $V_{\max}$ [\si{\metre\per\second}] \\ 
    \Xhline{1.2pt}
3   &   0.90    \\ \hline
4   &   1.02    \\ \hline
5   &   1.03    \\ \hline
6   &   0.97    \\ \hline
7   &   0.96    \\ \hline
8   &   0.95    \\ \hline
9   &   1.03    \\ \hline
10  &   1.03    \\ 
    \Xhline{1.2pt}
\end{tabular}
    \end{table}
\end{document}

enter image description here

Addendum: You may consider to "liberate" tabulars contents from jail of vertical and horizontal rules and simplify your tables code to:

\documentclass[slovene,12pt]{article}
\usepackage[hmargin={30mm,25mm},
            vmargin={20mm,29mm}
           ]{geometry}
\usepackage{siunitx}
\usepackage{booktabs}

\begin{document}
    \begin{table}[ht]
    \sisetup{per-mode=symbol} % if you like to have units written using fractions
\begin{tabular}[t]{ c c }
    \toprule
$R [\si{cm}]$
    &$V_{\max} [\si{\metre\per\second}]$  \\
    \midrule
1,0 &   0.95    \\
3,0 &   1.03    \\
5,0 &   0.89    \\
7,0 &   1.04    \\
    \toprule
\end{tabular}
\hfill%
\begin{tabular}[t]{ c c }
    \toprule
$\rho_p [\si{\gram\per\square\metre}]$
    &   $V_{max}$ [\si{\metre\per\second}] \\
    \midrule
75  &   0.89    \\ 
80  &   0.95    \\
90  &   1.07    \\
100 &   1.09    \\
160 &   1.47    \\
170 &   1.42    \\
200 &   1.64    \\
250 &   1.70    \\
    \bottomrule
\end{tabular}%
\hfill%
\begin{tabular}[t]{c<{\si{\degree}} c}
    \toprule
\multicolumn{1}{c}{$\alpha$}
    &   $V_{\max}$ [\si{\metre\per\second}] \\
    \midrule
30  &   1.43    \\ 
40  &   1.02    \\ 
50  &   0.91    \\ 
60  &   0.77    \\
    \bottomrule
\end{tabular}%
\hfill
\begin{tabular}[t]{ c c }
    \toprule
n   &   $V_{\max}$ [\si{\metre\per\second}] \\
    \midrule
3   &   0.90    \\
4   &   1.02    \\
5   &   1.03    \\
6   &   0.97    \\
7   &   0.96    \\
8   &   0.95    \\
9   &   1.03    \\ 
10  &   1.03    \\
    \bottomrule
\end{tabular}
    \end{table}
\end{document}

As you can see, for horizontal rules are now used rules defined in booktabs, increase are font size to ˙\normalsize and for units are used fraction where needed:

enter image description here

3
  • Thanks, it worked. Commented Mar 11, 2021 at 20:12
  • @GalZoidberg, see addendum to my answer (mogoče vam bo všeč) ;-)
    – Zarko
    Commented Mar 11, 2021 at 20:18
  • Yes, that also looks nice. Commented Mar 11, 2021 at 22:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .