[Tex/LaTex] multicolumn table with a legend in latex

booktabsmulticolumntables

I'm not very experienced in drawing tables in latex, but for this paper I have no choice. Please forgive me, if this is a stupid question.

So, here's my preamble:

\documentclass[a4paper, 12pt]{article}
\usepackage[english]{babel}
\usepackage[applemac]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{enumerate}
\usepackage{array}
\usepackage{multirow}
\usepackage{setspace}
\usepackage[pdftex]{hyperref}
\usepackage{wasysym}
\usepackage{graphicx}
\usepackage{booktabs}
\title{title}
\author{author}
\hypersetup{pdfauthor={author}, pdftitle={title}, pdfborder={0 0 0},}
\begin{document}

...

I'm trying to draw this table:
\begin{table}[h!]
\caption{Mirror movements according to Woods \& Teuber}
\begin{tabular}[l | c c c c | c c c c | c c c c ]
\toprule
 & \multicolumn{4}{|c}{CP Norway}&\multicolumn{4}{|c}{CP Australia}& \multicolumn{4}{|c}{TD children}\\
            & 1 & 2 & 3 & 4     & 1 & 2 & 3 & 4     & 1 & 2 & 3 & 4 \\
\midrule
            &    &    &    &        &    &    &    &        &    &    &    &        \\
W\&T score 0 & 3 & 2 &  6 & 3   & 1 & 3 & 1 & 1     &16& 9 &13& 8       \\
W\&T score 1 & 4 & 3 &  3 & 4   & 4 & 3 &   2 & 2       & 5 & 9 &   9 & 8       \\
W\&T score 2 & 6 & 7 &  7 & 6   & 12&10&11&10 & 1 & 4 & 0 & 6       \\
W\&T score 3 & 2 & 5 &  1 & 2   & 1 & 2 &   3 & 3       & 0 & 0 &   0 & 0       \\
W\&T score 4 & 4 & 2 &  2 & 4   & 0 & 0 &   1 & 2       & 0 & 0 &   0 & 0       \\
\bottomrule
\end{tabular}
\bigskip
1: Mirror movements in the affected hand, while the unaffected hand is moving at normal speed. 2: Mirror movements in the affected hand, while the unaffected hand is moving at fast speed. 3: Mirror movements in the unaffected hand as the affected hand is moving at normal speed. 4: Mirror movements in the unaffected hand as the affected hand is moving at fast speed. For TD children, the non-dominant hand corresponds to the affected hand.
\label{tab:WT}
\end{table}

...
\end{document}

and get the following error message:

illegal pream-token (\toprule): c' used

can anyone help me?

Best Answer

As mentioned in comment, you had your column specifiers in brackets instead of braces. Please see my below code:

% arara: pdflatex

\documentclass[a4paper,12pt]{article}
\usepackage[applemac]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{caption}
\usepackage{threeparttable}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage[pdftex]{hyperref} % should be last package to be loaded. I have not checked, what that option is for...

\begin{document}
I've succeeded to draw this table:
\begin{table}[h!] % just use this specifier if really needed.
    \centering
    \begin{threeparttable}
    \caption{Mirror movements according to Woods \& Teuber}\label{tab:WT}
    \begin{tabular}{l@{\hspace{5mm}} *{4}{S[table-format=1.0]} *{4}{S[table-format=2.0]} S[table-format=2.0]S[table-format=1.0]S[table-format=2.0]S[table-format=1.0]}
        \toprule
        & \multicolumn{4}{c}{CP Norway}&\multicolumn{4}{c}{CP Australia}& \multicolumn{4}{c}{TD children}\\
        \cmidrule{2-5}\cmidrule(lr){6-9}\cmidrule{10-13}
        & 1 & 2 & 3 & 4     & 1 & 2 & 3 & 4     & 1 & 2 & 3 & 4 \\
        \midrule
        W\&T score $$0 & 3 & 2 &  6 & 3   & 1 & 3 & 1 & 1     &16& 9 &13& 8       \\
        W\&T score $1$ & 4 & 3 &  3 & 4   & 4 & 3 &   2 & 2       & 5 & 9 &   9 & 8       \\
        W\&T score $2$ & 6 & 7 &  7 & 6   & 12&10&11&10 & 1 & 4 & 0 & 6       \\
        W\&T score $3$ & 2 & 5 &  1 & 2   & 1 & 2 &   3 & 3       & 0 & 0 &   0 & 0       \\
        W\&T score $4$ & 4 & 2 &  2 & 4   & 0 & 0 &   1 & 2       & 0 & 0 &   0 & 0       \\
        \bottomrule
    \end{tabular}
    \begin{tablenotes}
        \item[1] Mirror movements in the affected hand, while the unaffected hand is moving at normal speed. 
        \item[2] Mirror movements in the affected hand, while the unaffected hand is moving at fast speed. 
        \item[3] Mirror movements in the unaffected hand as the affected hand is moving at normal speed. 
        \item[4] Mirror movements in the unaffected hand as the affected hand is moving at fast speed. For TD children, the non-dominant hand corresponds to the affected hand.
    \end{tablenotes}
    \end{threeparttable}
\end{table}
\end{document}

enter image description here

Related Question