[Tex/LaTex] break a table on two columns

tablestwo-column

I have a table that is quite long (less than a page, by the way) and quite narrow; to save space I wish to have it, let's say, on two columns. Referring to the following image, I wish to have the first 8 entries side by side with the entries 9-16 (note that the letter "A", "B", and so on are added for code readability purpose, in the original table the column "schema" contains a image that increase the rows height).

Example result

The code of the example is as follows:

\documentclass[a4paper]{report}

\usepackage{booktabs}
\usepackage{fullpage}
\usepackage{multirow}
\usepackage[table]{xcolor}
\usepackage{array}
\usepackage[pdftex]{graphicx}

\begin{document}

\begin{table}[htbp]
  \centering
    \begin{tabular}{llp{0.1cm}p{0.1cm}p{0.1cm}p{0.1cm}lp{3cm}}
    \toprule
& & \multicolumn{4}{c}{Parameter} & & \\
ID & Schema & F & E & P & N & \multicolumn{2}{l}{Cluster}\\
    \midrule
1 & A & H & H & H & H & 1 & High performer\\
2 & B & H & H & H & L & 2 & Cash provider\\
3 & C & H & H & L & H & 3 & Alternative means of financing\\
4 & D & H & H & L & L & 4 & Doubtful case\\
5 & E & H & L & H & H & 5 & Low performer\\
6 & F & H & L & H & L & 5 & Low performer\\
7 & G & H & L & L & H & 6 & Possible AMF\\
8 & H & H & L & L & L & 5 & Low performer\\
9 & I & L & H & H & H & 7 & Cash flow optimization\\
10 & L & L & H & H & L & 7 & Cash flow optimization\\
11 & M & L & H & L & H & 8 & SCF needy\\
12 & N & L & H & L & L & 7 & Cash flow optimization\\
13 & O & L & L & H & H & 4 & Doubtful case\\
14 & P & L & L & H & L & 9 & Potential cash provider\\
15 & Q & L & L & L & H & 5 & Low performer\\
16 & R & L & L & L & L & 5 & Low performer\\
    \bottomrule
    \end{tabular}%
  \caption{Cluster identification.}
  \label{clusteridentification}%
\end{table}%

\end{document}

Ok now I know that there are different solutions to this problem:

  • The first would be to "double" the table, with the header that would look like:

    \toprule
    & & \multicolumn{4}{c}{Parameter} & & & & \multicolumn{4}{c}{Parameter} & & \\
    ID & Schema & F & E & P & N & \multicolumn{2}{l}{Cluster} ID & Schema & F & E & P & N & \multicolumn{2}{l}{Cluster}\\
    \midrule

    Anyway, this solution is not very flexible, and won't be easy to manipulate the table in the future (and it's probable that I'll have to do it, and let's say it: it's ugly)

  • The twocolumn environment is out of discussion, because the rest of the page must be written as the rest of the document, on one column.

  • The minipage structure gives problems with the \table environment: I cannot compile the document!

Best Answer

While I was writing my question, I came out with the solution. If I understood correctly, it is encouraged for user of this (rather awesome) website to answer their own question, therefore, even if I think that my question is quite trivial, here I go:

The minipage construct is the solution: it just needs to be within the table environment. The correct code to achieve what I wished is:

\begin{table}
\begin{minipage}[t]{0.5\linewidth}
    \begin{tabular}[t]{llp{0.1cm}p{0.1cm}p{0.1cm}p{0.1cm}lp{3cm}}
    \toprule
& & \multicolumn{4}{c}{Parameter} & & \\
ID & Schema & F & E & P & N & \multicolumn{2}{l}{Cluster}\\
    \midrule
1 & A & H & H & H & H & 1 & High performer\\
2 & B & H & H & H & L & 2 & Cash provider\\
3 & C & H & H & L & H & 3 & Alternative means of financing\\
4 & D & H & H & L & L & 4 & Doubtful case\\
5 & E & H & L & H & H & 5 & Low performer\\
6 & F & H & L & H & L & 5 & Low performer\\
7 & G & H & L & L & H & 6 & Possible AMF\\
8 & H & H & L & L & L & 5 & Low performer\\
    \bottomrule
    \end{tabular}%
\end{minipage}
\begin{minipage}[t]{0.5\linewidth}
    \begin{tabular}[t]{llp{0.1cm}p{0.1cm}p{0.1cm}p{0.1cm}lp{3cm}}
    \toprule
& & \multicolumn{4}{c}{Parameter} & & \\
ID & Schema & F & E & P & N & \multicolumn{2}{l}{Cluster}\\
    \midrule
9 & I & L & H & H & H & 7 & Cash flow optimization\\
10 & L & L & H & H & L & 7 & Cash flow optimization\\
11 & M & L & H & L & H & 8 & SCF needy\\
12 & N & L & H & L & L & 7 & Cash flow optimization\\
13 & O & L & L & H & H & 4 & Doubtful case\\
14 & P & L & L & H & L & 9 & Potential cash provider\\
15 & Q & L & L & L & H & 5 & Low performer\\
16 & R & L & L & L & L & 5 & Low performer\\
    \bottomrule
    \end{tabular}%
\end{minipage}
\caption{caption}
\end{table}

Of course small adjustments to properly fit the text are needed, but it works.