Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
I have problems understanding your question. Full is centered above the first 8 columns. There are 11 columns all in all, so \multicolumn{11}{c}{Full} will center Full above all columns. The space between columns is adjusted with \tabcolsep. –  Stephan Lehmke Oct 5 '12 at 4:56
add comment

1 Answer 1

up vote 7 down vote accepted

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.

share|improve this answer
    
Thanks a lot :) –  tikzlearner Oct 5 '12 at 5:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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