多个表格并排

多个表格并排

我有以下表格并想将它们并排放在一起。

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

我尝试了很多指令,例如将所有表格放在表格内。它们都只适用于表格,而不适用于表格。

我怎样才能让它适用于这些表?

答案1

正如@DavidCarlisle在他的评论中指出的那样,只需将所有表格收集到一个表格中table。我擅自对您的代码进行了一些更改:

  • 对于单位现在采用的包siunitx
  • 厚的hline是使用\Xhline{1.2pt}makecell包装
  • 用于粗垂直线 !{\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}

在此处输入图片描述

附录: 您可以考虑将表格内容从垂直和水平规则的束缚中“解放”出来,并将表格代码简化为:

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

正如您所看到的,对于水平规则现在使用在中定义的规则,booktabs, increase are font size to ˙\normalsize并且对于单位在需要时使用分数:

在此处输入图片描述

相关内容