[Tex/LaTex] how to \multicolumn in booktabs

booktabstables

Following is my code:

\documentclass[a4paper,10pt]{article}
%\documentclass[a4paper,10pt]{scrartcl}

\usepackage[utf8x]{inputenc}
\usepackage{booktabs}


\begin{document}

\begin{table}[htbp]
\caption{Case-studies}
\centering
\begin{tabular}{lllllllllll}
\toprule
\multicolumn{8}{c}{Full}  \\

\cmidrule(r){4-5}
\cmidrule(r){6-7}
\cmidrule(r){8-9}
\cmidrule(r){10-11}

Name & Name & Name & Name & Name. & Name & Name. & Name & Name. & Name & Name. \\
\midrule
John & Doe & $7.5$ \\
Richard & Miles & $2$ \\
\bottomrule
\end{tabular}
\label{case-studies}
\end{table}


\end{document}

The output is :
enter image description here

I want to label "Full" above other columns also. How to do that?
And how to change the spacing between two columns?

Best Answer

You are probably looking for the following layout:

enter image description here

\documentclass[a4paper,10pt]{article}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\begin{document}
\begin{table}[htbp]
  \centering
  \caption{Case-studies}
  \begin{tabular}{*{11}{l}}
    \toprule
    & & & \multicolumn{2}{c}{Full} & \multicolumn{2}{c}{Full} 
      & \multicolumn{2}{c}{Full} & \multicolumn{2}{c}{Full} \\
    \cmidrule(lr){4-5}
    \cmidrule(lr){6-7}
    \cmidrule(lr){8-9}
    \cmidrule(lr){10-11}
    Name & Name & Name & Name & Name. & Name & Name. & Name & Name. & Name & Name. \\
    \midrule
    John & Doe & $7.5$ \\
    Richard & Miles & $2$ \\
    \bottomrule
  \end{tabular}
  \label{case-studies}
\end{table}
\end{document}

Note that the table caption is not properly aligned since the tabular structure is too wide. If need be, you can adjust the column separation which provides a tighter view and possibly make the table fit within the page boundary.

The default of \tabcolsep is 6pt. Anything smaller will shrink the tabular horizontally. Using something like \setlength{\tabcolsep}{3pt}. You could also consider increasing the text block margin using geometry.

Related Question