0

I make a very big data table, but the table don't fit in the page, so I slice the table in three tables. I want the three tables are next to each other separated by the same space or then joined by a line because are about the same subject. The code is:

\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}
6
  • \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\\ Apr 12 '16 at 21:36
  • \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} Apr 12 '16 at 21:37
  • 1
    If a tabledoes not fit on a page width, how can the same split table fit on the page? I'm missing something here…
    – Bernard
    Apr 12 '16 at 21:40
  • 1
    Please ensure that your code compiles before uploading it. I guarantee yours will give you errors if you try it ;).
    – cfr
    Apr 12 '16 at 22:01
  • 1
    I see. Your might use longtable for tables requiring more than one page, but I think your solution is better (once it works ;o).
    – Bernard
    Apr 12 '16 at 22:18
2

A line break is a space. Since you have requested

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

the last box gets moved to the line below because TeX can't fit \textwidth + 2 spaces into \textwidth.

To resolve this, just comment the line endings:

\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-in-1

However, this kind of style is not recommended. The excess of horizontal rules will hinder, rather than helping, your readers. Moreover, vertical rules ought not be used in the same table as the rules provided by booktabs. (According to booktabs, they ought not be used ever. But they certainly should not be combined.) The output clearly shows why: the gappiness around the intersections of horizontal and vertical rules looks most strange.

1
  • Thanks for the help and advice. You are right, the tables on this way are very condensed and the teacher call me attention. And thanks for the theoretical explanation! I don't know much about LATEX and all that I know I learn here! :) Apr 12 '16 at 23:52
2

Without any minipage, just \hfill. I used the S column type from siunitx in order to align the decimal commas, and replaced the \hlines with some vertical padding with the makecell package (cellspace won't work with the S column type):

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

enter image description here

5
  • I appreciate your help. In Latex appear me two horizontal lines (the first and the last one) in bold only in the third table and in the other two tables appear me in the first and last one lines, a line with the thickness by default. How can I put the two lines of other two tables in bold two for homogenize the article? Apr 12 '16 at 23:36
  • And I like that table style that showed me, is very professional, I think it will look good at work, just missing even get that little detail that I do not know how, about the lines. Apr 12 '16 at 23:40
  • 1
    I'm not sure I understand well what you mean. You would like to have the second line with the same thickness as the top and bottom lines?
    – Bernard
    Apr 12 '16 at 23:45
  • sorry this is an akward moment. In the computer I see the tables like I describe previously, but when I impress the tables the lines appear like you put in the image, but I see in computer the top and bottom lines of the third table in bold, but the top and bottom lines of the other two tables are with the thickness by default, so this lines appear in computer without bold. Sorry, I don't speak English, but I try :) Apr 12 '16 at 23:48
  • 1
    That is probably due to a default of your pdf viewer. Generally, this disappears on zooming.
    – Bernard
    Apr 12 '16 at 23:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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