3

enter image description hereWhy this table goes outside the page:

    \documentclass[11pt,twoside,a4paper]{report}
    \usepackage{graphicx}

        \usepackage{makeidx}
        \usepackage{multirow}
        \usepackage{tikz}
        \usepackage{array,booktabs,siunitx}
        \usepackage[italian]{babel}
        \usepackage[T1]{fontenc}
        \makeindex
        \begin{document}
        \tableofcontents
        \printindex
               \begin{table}[htbp]
\begin{tabular}{|c|c|c|c|c|}
\toprule
T $^\circ$ C & 6 $^\circ$ C & 20 $^\circ$ C & 37 $^\circ$ C \\
\toprule
Solvente & conc. (\%p/V) & contenuto fase liq. (\%) & contenuto fase liq. (\%) & contenuto fase liq.(\%)  \\
\midrule
\multirow{4}{*}{Water}& 1 & 84.3 $\pm$ 0.1 & 99.2 $\pm$ 0.1 & 98.9 $\pm$ 0.1\\
& 2 & 84.3 $\pm$ 0.1 & - & 98.9 $\pm$ 0.2 \\
& 3 & 84.3 $\pm$ 0.1 & 99.2 $\pm$ 0.1 & - \\
& 4 & 84.5 $\pm$ 0.1 & 90 $\pm$ 5 & 83.3 $\pm$ 0.2\\
\midrule
\multirow{4}{*}{Saline} &1 &  99.1 $\pm$ 0.1 & 98.9 $\pm$ 0.1 & 99.3 $\pm$ 0.1\\
& 2 & 99.2 $\pm$ 0.1 & 99.1 $\pm$ 0.1 & 99.4 $\pm$ 0.2 \\
& 3 & 99.1 $\pm$ 0.1 & 98.9 $\pm$ 0.2 & 99.5 $\pm$ 0.1 \\
& 4 & 99.2 $\pm$ 0.1 & 99.1 $\pm$ 0.1 & 98.8 $\pm$ 0.2 \\
\midrule
\multirow{4}{*}{PBS } & 1 & 99.1 $\pm$ 0.1 & - & 99.5 $\pm$ 0.1 \\
& 2 & 99.0 $\pm$ 0.2 & - & 99.3 $\pm$ 0.1\\
& 3 & 99.4 $\pm$ 0.1 & 99.7 $\pm$ 0.1 & 99.5 $\pm$ 0.1\\
& 4 & 99.4 $\pm$ 0.1 & 99.0 $\pm$ 0.1 & 99.2 $\pm$ 0.2\\
\bottomrule
\end{tabular}
\caption{\emph{Rapporto liquido/solido per i campioni in acqua, in soluzione fisiologica e in tampone fosfato alle concentrazioni del 1, 2, 3, 4\% p/V, alle temperature di 6, 20, 37$^\circ$ C}}
\end{table}
  • 3
    You could shorten the table column headers (add a third line break or delete repeaded information). Unrelated to the issue: If you use booktabs horizontal lines you should also avoid vertical lines (see the booktabs manual). If you are interested in aligning numbers in table columns you ight want to have a look at the siunitx package. – leandriis Apr 4 at 11:39
6

You asked,

Why [does] this table goes outside the page?

It's mostly because the header cells contains a lot of (repeated) information and no intra-cell line breaks are allowed.

The most appealing solution, in my opinion, consists of reorganizing and rearranging the header cells to get rid of the repetitive material.

I would also get rid of all vertical lines. They're not needed -- really!

enter image description here

\documentclass[11pt,twoside,a4paper]{report}
    %%% (commented out all packages not needed for this example)
    %\usepackage{graphicx}
    %\usepackage{makeidx}
    %\usepackage{multirow}
    %\usepackage{tikz}
    \usepackage{array,booktabs,siunitx}
    \usepackage[italian]{babel}
    \usepackage[T1]{fontenc}
    %\makeindex
    \begin{document}
    %\tableofcontents
    %\printindex

        \begin{table}[htbp]
        \centering
        \begin{tabular}{@{} ccccc @{}}
        \toprule
        conc.\ (\%p/V)& \multicolumn{3}{c}{Contenuto fase liq. (\%)} & Solvente \\
        \cmidrule(lr){2-4}
        & \SI{6}{\celsius} & \SI{20}{\celsius} & \SI{37}{\celsius} \\
        \midrule
        1 & 84.3 $\pm$ 0.1 & 99.2 $\pm$ 0.1 & 98.9 $\pm$ 0.1 & water\\
        2 & 84.3 $\pm$ 0.1 & -- & 98.9 $\pm$ 0.2 & water \\
        3 & 84.3 $\pm$ 0.1 & 99.2 $\pm$ 0.1 & -- & water \\
        4 & 84.5 $\pm$ 0.1 & 90 $\pm$ 5 & 83.3 $\pm$ 0.2 & water\\ \addlinespace
        1 & 99.1 $\pm$ 0.1 & 98.9 $\pm$ 0.1 & 99.3 $\pm$ 0.1 & saline \\
        2 & 99.2 $\pm$ 0.1 & 99.1 $\pm$ 0.1 & 99.4 $\pm$ 0.2 & saline\\
        3 & 99.1 $\pm$ 0.1 & 98.9 $\pm$ 0.2 & 99.5 $\pm$ 0.1 & saline\\
        4 & 99.2 $\pm$ 0.1 & 99.1 $\pm$ 0.1 & 98.8 $\pm$ 0.2 & saline\\ \addlinespace
        1 & 99.1 $\pm$ 0.1 & -- & 99.5 $\pm$ 0.1 & PBS\\
        2 & 99.0 $\pm$ 0.2 & -- & 99.3 $\pm$ 0.1 & PBS \\
        3 & 99.4 $\pm$ 0.1 & 99.7 $\pm$ 0.1 & 99.5 $\pm$ 0.1 & PBS\\
        4 & 99.4 $\pm$ 0.1 & 99.0 $\pm$ 0.1 & 99.2 $\pm$ 0.2 & PBS \\
        \bottomrule
        \end{tabular}
        \caption{Rapporto liquido/solido per i campioni in acqua, in soluzione fisiologica e in tampone fosfato alle concentrazioni del 1, 2, 3, 4\% p/V, alle temperature di 6, 20, e \SI{37}{\celsius}.}
        \end{table}
\end{document} 
  • I removed some duplicate information like repeating water multiple times saline....but it is still outside – Giuliano Malatesta Apr 4 at 12:04
  • 1
    @GiulianoMalatesta - Removing repeated instances of "Water" and "Saline" does not affect the overall *width" of the tabular material. To reduce its width, one has to do something about the header material. – Mico Apr 4 at 14:05
2

To exemplify (I hope!) the above comments, I would try

\documentclass[11pt,twoside,a4paper]{report}
    \usepackage{array,booktabs,siunitx,rotating}
    \usepackage[italian]{babel}
    \usepackage[T1]{fontenc}
    \begin{document}
\begin{table}[p]
        \begin{tabular}{ccccc}
        \toprule
        T $^\circ$ C & 6 $^\circ$ C & 20 $^\circ$ C & 37 $^\circ$ C \\
        conc. (\%p/V) & \multicolumn{1}{p{2cm}}{\centering contenuto fase liq. (\%)} & \multicolumn{1}{p{2cm}}{\centering 
        contenuto fase liq. (\%)} & \multicolumn{1}{p{2cm}}{\centering contenuto fase liq.(\%)} & solvente \\
        \midrule
        1 & 84.3 $\pm$ 0.1 & 99.2 $\pm$ 0.1 & 98.9 $\pm$ 0.1 & water\\
        2 & 84.3 $\pm$ 0.1 & - & 98.9 $\pm$ 0.2 & water \\
        3 & 84.3 $\pm$ 0.1 & 99.2 $\pm$ 0.1 & - & water \\
        4 & 84.5 $\pm$ 0.1 & 90 $\pm$ 5 & 83.3 $\pm$ 0.2 & water\\
        1 & 99.1 $\pm$ 0.1 & 98.9 $\pm$ 0.1 & 99.3 $\pm$ 0.1 & saline \\
        2 & 99.2 $\pm$ 0.1 & 99.1 $\pm$ 0.1 & 99.4 $\pm$ 0.2 & saline\\
        3 & 99.1 $\pm$ 0.1 & 98.9 $\pm$ 0.2 & 99.5 $\pm$ 0.1 & saline\\
        4 & 99.2 $\pm$ 0.1 & 99.1 $\pm$ 0.1 & 98.8 $\pm$ 0.2 & saline\\
        1 & 99.1 $\pm$ 0.1 & - & 99.5 $\pm$ 0.1 & PBS\\
        2 & 99.0 $\pm$ 0.2 & - & 99.3 $\pm$ 0.1 & PBS \\
        3 & 99.4 $\pm$ 0.1 & 99.7 $\pm$ 0.1 & 99.5 $\pm$ 0.1 & PBS\\
        4 & 99.4 $\pm$ 0.1 & 99.0 $\pm$ 0.1 & 99.2 $\pm$ 0.2 v PBS \\
        \bottomrule
        \end{tabular}
\caption{Rapporto liquido/solido per i campioni in acqua, in soluzione fisiologica 
e in tampone fosfato alle concentrazioni del 1, 2, 3, 4\% p/V, alle temperature di 6, 20, 37$^\circ$ C}
\end{table}
\end{document}

enter image description here

  • @Giuliano Malatesta Also, it seems that there is typo in the last line before PBS. I did not modify that since I am unsure. – Denis Apr 4 at 11:59
  • @Giuliano Malatesta Also, the decimal separator in Italian is the comma, AFAIK. – Denis Apr 4 at 12:09
2

mostly off-topic, as variation of nice @Mico answer. exploited is separate-uncertainty=true for shorter typing of numbers in S columns:

\documentclass[11pt,twoside,a4paper]{report}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage{array,booktabs,siunitx}

\begin{document}
    \begin{table}[htbp]
    \centering
\begin{tabular}{c
           *{3}{S[table-format=2.1(1),
                  separate-uncertainty=true,
                  output-decimal-marker={,}]}
                l}
\toprule
T \si{\celsius}
    &   \multicolumn{3}{c}{contenuto fase liq. (\%)}
                                        &   solvente\\
    \cmidrule{2-5}
conc. (\%p/V)
    & \SI{6}{\celsius}
                & \SI{20}{\celsius}
                            & \SI{37}{\celsius}     \\
    \midrule
1   & 84.3(1)  & 99.2(1)   & 98.9(1)   & water      \\
2   & 84.3(1)    & {--}      & 98.9(2)   & water    \\
3   & 84.3(1)    & 99.2(1)   & {--}      & water    \\
4   & 84.5(1)    & 90(5)     & 83.3(2)   & water    \\
1   & 99.1(1)    & 98.9(1)   & 99.3(1)   & saline   \\
2   & 99.2(1)    & 99.1(1)   & 99.4(2)   & saline   \\
3   & 99.1(1)    & 98.9(2)   & 99.5(1)   & saline   \\
4   & 99.2(1)    & 99.1(1)   & 98.8(2)   & saline   \\
1   & 99.1(1)    & {--}      & 99.5(1)   & PBS      \\
2   & 99.0(2)    & {--}      & 99.3(1)   & PBS      \\
3   & 99.4(1)    & 99.7(1)   & 99.5(1)   & PBS      \\
4   & 99.4(1)    & 99.0(1)   & 99.2(2)   & PBS      \\
    \bottomrule
\end{tabular}
\caption{Rapporto liquido/solido per i campioni in acqua, in soluzione fisiologica e in tampone fosfato alle concentrazioni del 1, 2, 3, \SI{4}{\% p/V}, alle temperature di 6, 20, \SI{37}{\celsius}.}
\end{table}
\end{document}

enter image description here

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.