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.

In a table a long label for a column often needs to be split into two parts. I usually do this manually by putting each part in a row of its own but it feels wrong because it splits a semantic entity. Would it be better to use \shortstack? In the example below Nov '10 to Apr '11 is split in such a way.

\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}
    \let\mc\multicolumn
    \centering
    \begin{tabular}{@{}rrrrl@{}}
        \toprule
          \mc4c{Entry Period} \\
          \cmidrule{1-4}
          \mc2c{Nov 2010}     & \mc2c{Nov 2009} &  \\
          \mc2c{to Apr 2011}  & \mc2c{to Apr 2010} &  Age\\
          \cmidrule(r){1-2} \cmidrule(rl){3-4} \cmidrule(l){5-5}
          Published & Count & Published & Count   & \\
        \midrule
          2010  & 26133   & 2009   & 16688    &  recent         \\
          2009  & 68761   & 2008   & 55592    &  1 year         \\
          2008  & 18450   & 2007   &  9572    &  2 years        \\
          2007 & 43046    & 2006   & 15106    &  older          \\
            \bottomrule
    \end{tabular}        
\end{table}
\end{document}

Table

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

You can combine \multirow and \multicolumn, load the multirow package for that. For example:

\multicolumn{2}{c}{\multirow{2}{3cm}{\centering Nov 2010\\to Apr 2011}}
share|improve this answer
    
I tried also \multicolumn2c{\shortstack{\strut Nov 2010\\to Apr 2011}}. This creates a high row whereas your solution provides control over the number of rows being used. –  Christian Lindig May 29 '11 at 10:57
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.