三张桌子之间的空间相同

三张桌子之间的空间相同

我制作了一个非常大的数据表,但表格不适合页面,因此我将表格分成三个表格。我希望这三个表格彼此相邻,由相同的空间隔开,或者由一条线连接,因为它们涉及同一主题。代码是:

\documentclass{article}
\begin{document}
\usepackage{booktabs}
\begin{table}[H]
\begin{minipage}{.3\textwidth}
\scriptsize
\centering
\begin{tabular}{c|c}
\toprule
Tempo (s) & Per\'{i}odo (s)\\
\midrule
0,8704 & 1,1507\\ \hline 2,021 & 1,1506\\ \hline 3,1715 & 1,1505\\
\hline 4,3221 & 1,1506\\ \hline 5,4726 & 1,1504\\ \hline 6,6230 & 1,1505\\ 
\hline 7,7735 & 1,1504\\ \hline 8,9239 & 1,1504\\ \hline 10,0743 & 1,1504\\
\hline 11,2247 & 1,1504\\ \hline 12,3751 & 1,1503\\ \hline 13,5254 & 1,1504\\
\hline 14,6758 & 1,1503\\ \hline 15,8260 & 1,1502\\ \hline 16,9762 & 1,1502\\
\hline 18,1264 & 1,1502\\ \hline 19,2766 & 1,1502\\ \hline 20,4268 & 1,1502\\
\bottomrule
\end{tabular}
\end{minipage}
\begin{minipage}{.3\textwidth}
\scriptsize
\begin{tabular}{c|c}
\toprule
Tempo (s) & Per\'{i}odo (s)\\
\midrule
21,5769 & 1,1501\\ \hline 22,7270 & 1,1501\\ \hline 23,8771 & 1,1500\\
\hline 25,0271 & 1,1501\\ \hline 26,1771 & 1,1499\\ \hline 27,3270 & 1,1498\\
\hline 28,4768 & 1,1498\\ \hline 29,6265 & 1,1497\\ \hline 30,7761 & 1,1494\\
\hline 31,9254 & 1,1492\\ \hline 33,0746 & 1,1492\\ \hline 34,2237 & 1,1490\\
\hline 35,3726 & 1,1489\\ \hline 36,5214 & 1,1487\\ \hline 37,6701 & 1,1486\\
\hline 38,8186 & 1,1485\\ \hline 39,9671 & 1,1484\\ \hline 41,1154 & 1,1482\\
\bottomrule
\end{tabular}
\end{minipage}
\begin{minipage}{.4\textwidth}
\scriptsize
\begin{tabular}{c|c}
\toprule
Tempo (s) & Per\'{i}odo (s)\\
\midrule
42,2636 & 1,1483\\ \hline 43,4119 & 1,1482\\ \hline 44,5601 & 1,1482\\
\hline 45,7082 & 1,1481\\ \hline 46,8563 & 1,1481\\ \hline 48,0044 & 1,1481\\
\hline 49,1525 & 1,1480\\ \hline 50,3004 & 1,1479\\ \hline 51,4483 & 1,1478\\
\hline 52,5961 & 1,1479\\ \hline 53,7439 & 1,1477\\ \hline 54,8916 & 1,1477\\
\hline 56,0393 & 1,1477\\ \hline 57,1870 & 1,1476\\ \hline 58,3346 & 1,1476\\
\hline M\'{e}dia & 1,1493\\ \hline Desvio Padr\~{a}o & 0,00107512\\ \hline N$^{\circ}$ contagens & 51\\
\bottomrule
\end{tabular}
\end{minipage}
\end{table}
\end{document}

答案1

换行符是一个空格。由于您已请求

.3\textwidth + space + .3\textwidth + space + .4\textwidth

最后一个框被移动到了下面一行,因为 TeX 无法\textwidth + 2 spaces容纳\textwidth

为了解决这个问题,只需注释掉行尾:

\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}
  \begin{minipage}{.3\textwidth}
    \scriptsize
    \centering
    \begin{tabular}{c|c}
      \toprule
      Tempo (s) & Per\'{i}odo (s)\\
      \midrule
      0,8704 & 1,1507\\ \hline 2,021 & 1,1506\\ \hline 3,1715 & 1,1505\\
      \hline 4,3221 & 1,1506\\ \hline 5,4726 & 1,1504\\ \hline 6,6230 & 1,1505\\
      \hline 7,7735 & 1,1504\\ \hline 8,9239 & 1,1504\\ \hline 10,0743 & 1,1504\\
      \hline 11,2247 & 1,1504\\ \hline 12,3751 & 1,1503\\ \hline 13,5254 & 1,1504\\
      \hline 14,6758 & 1,1503\\ \hline 15,8260 & 1,1502\\ \hline 16,9762 & 1,1502\\
      \hline 18,1264 & 1,1502\\ \hline 19,2766 & 1,1502\\ \hline 20,4268 & 1,1502\\
      \bottomrule
    \end{tabular}
  \end{minipage}%
  \begin{minipage}{.3\textwidth}
    \scriptsize
    \begin{tabular}{c|c}
      \toprule
      Tempo (s) & Per\'{i}odo (s)\\
      \midrule
      21,5769 & 1,1501\\ \hline 22,7270 & 1,1501\\ \hline 23,8771 & 1,1500\\
      \hline 25,0271 & 1,1501\\ \hline 26,1771 & 1,1499\\ \hline 27,3270 & 1,1498\\
      \hline 28,4768 & 1,1498\\ \hline 29,6265 & 1,1497\\ \hline 30,7761 & 1,1494\\
      \hline 31,9254 & 1,1492\\ \hline 33,0746 & 1,1492\\ \hline 34,2237 & 1,1490\\
      \hline 35,3726 & 1,1489\\ \hline 36,5214 & 1,1487\\ \hline 37,6701 & 1,1486\\
      \hline 38,8186 & 1,1485\\ \hline 39,9671 & 1,1484\\ \hline 41,1154 & 1,1482\\
      \bottomrule
    \end{tabular}
  \end{minipage}%
  \begin{minipage}{.4\textwidth}
    \scriptsize
    \begin{tabular}{c|c}
      \toprule
      Tempo (s) & Per\'{i}odo (s)\\
      \midrule
      42,2636 & 1,1483\\ \hline 43,4119 & 1,1482\\ \hline 44,5601 & 1,1482\\
      \hline 45,7082 & 1,1481\\ \hline 46,8563 & 1,1481\\ \hline 48,0044 & 1,1481\\
      \hline 49,1525 & 1,1480\\ \hline 50,3004 & 1,1479\\ \hline 51,4483 & 1,1478\\
      \hline 52,5961 & 1,1479\\ \hline 53,7439 & 1,1477\\ \hline 54,8916 & 1,1477\\
      \hline 56,0393 & 1,1477\\ \hline 57,1870 & 1,1476\\ \hline 58,3346 & 1,1476\\
      \hline M\'{e}dia & 1,1493\\ \hline Desvio Padr\~{a}o & 0,00107512\\ \hline N$^{\circ}$ contagens & 51\\
      \bottomrule
    \end{tabular}
  \end{minipage}
\end{table}
\end{document}

3 合 1

但是,不推荐这种样式。过多的水平线会妨碍而不是帮助读者。此外,垂直线不应与 提供的规则一起用于同一个表格中booktabs。(根据booktabs,它们永远都不应该使用。但它们肯定不应该组合在一起。)输出清楚地显示了原因:水平和垂直线交叉点周围的间隙看起来最奇怪。

答案2

没有任何小页面,只有\hfill。我使用了S列类型来siunitx对齐小数点逗号,并\hline使用包中的一些垂直填充替换了 s makecellcellspace不适用于 S 列类型):

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern} \usepackage{booktabs, float, siunitx, makecell}
\setcellgapes{3pt}

\begin{document}

\begin{table}[H]
  \scriptsize
  \centering\sisetup{table-format=2.4, table-number-alignment =center, output-decimal-marker={,}}
  \makegapedcells
  \begin{tabular}{S|S}
    \toprule
    \multicolumn{1}{c}{Tempo (s)} & {Período (s)}\\
    \midrule
    0,8704 & 1,1507 \\ 2,021 & 1,1506\\ 3,1715 & 1,1505\\
    4,3221 & 1,1506 \\ 5,4726 & 1,1504\\ 6,6230 & 1,1505\\
    7,7735 & 1,1504 \\ 8,9239 & 1,1504\\ 10,0743 & 1,1504\\
    11,2247 & 1,1504 \\ 12,3751 & 1,1503\\ 13,5254 & 1,1504\\
    14,6758 & 1,1503 \\ 15,8260 & 1,1502\\ 16,9762 & 1,1502\\
    18,1264 & 1,1502 \\ 19,2766 & 1,1502\\ 20,4268 & 1,1502\\
    \bottomrule
  \end{tabular}
  \hfill
  \begin{tabular}{S|S}
    \toprule
    \multicolumn{1}{c}{Tempo (s)}& {Período (s)} \\
    \midrule
    21,5769 & 1,1501 \\ 22,7270 & 1,1501\\ 23,8771 & 1,1500\\
    25,0271 & 1,1501 \\ 26,1771 & 1,1499\\ 27,3270 & 1,1498\\
    28,4768 & 1,1498 \\ 29,6265 & 1,1497\\ 30,7761 & 1,1494\\
    31,9254 & 1,1492 \\ 33,0746 & 1,1492\\ 34,2237 & 1,1490\\
    35,3726 & 1,1489 \\ 36,5214 & 1,1487\\ 37,6701 & 1,1486\\
    38,8186 & 1,1485 \\ 39,9671 & 1,1484\\ 41,1154 & 1,1482\\
    \bottomrule
  \end{tabular}
  \hfill
  \begin{tabular}{S|S}
    \toprule
    \multicolumn{1}{c}{Tempo (s)} & {Período (s)}\\
    \midrule
    42,2636 & 1,1483 \\ 43,4119 & 1,1482\\ 44,5601 & 1,1482\\
    45,7082 & 1,1481 \\ 46,8563 & 1,1481\\ 48,0044 & 1,1481\\
    49,1525 & 1,1480 \\ 50,3004 & 1,1479\\ 51,4483 & 1,1478\\
    52,5961 & 1,1479 \\ 53,7439 & 1,1477\\ 54,8916 & 1,1477\\
    56,0393 & 1,1477 \\ 57,1870 & 1,1476\\ 58,3346 & 1,1476\\
    {Média} & 1,1493 \\ {Desvio Padrão} & {0,00107512}\\ {N\textsuperscript{o} contagens} & {51}
    \\
    \bottomrule
  \end{tabular}
\end{table}

\end{document} 

在此处输入图片描述

相关内容