4

Consider the following example:

\documentclass{article}

\usepackage{booktabs,dcolumn,ragged2e}

\newcolumntype{d}[1]{D{.}{,}{#1}}
\newcommand*\mc[1]{\multicolumn{1}{c}{#1}}

\begin{document}

\begin{table}
 \centering
  \begin{tabular}{>{\RaggedRight\arraybackslash}p{4.4cm} d{2.1} d{2.1} d{2.1} d{2.1} d{2.1} d{2.1} d{2.1} d{2.1} d{2.1}}
   \toprule
    \mc{{\AA}rstal} & \mc{1997} & \mc{1998} & \mc{1999} & \mc{2000} & \mc{2001} & \mc{2002} & \mc{2003} & \mc{2004} & \mc{2005} \\[1ex]
    Antal passagerer i mio., som lufthavnen kan betjene
                    & 17.1 & 17.8 & 19.9 & 22.7 & 22.7 & 25.2 & 25.2 & 25.2 & 28.0 \\
    Forventet {\aa}rligt passagertal i mio.
                    & 16.6 & 17.4 & 18.2 & 19.0 & 20.0 & 20.9 & 22.0 & 23.1 & 24.2 \\
   \bottomrule
  \end{tabular}
\end{table}

\end{document}

output

How do I vertically center the numbers relativt to the blocks of text in the first column? Now, the numbers are vertically aligned at the top of the ``double lines''.

6

Use m{4.4cm} instead of p{4.4cm} for the first column.

dcolumn loads array as part of its required packages. The latter supports the m-column format. From the array documentation:

m{width} Defines a column of width width. Every entry will be centered in proportion to the rest of the line. It is somewhat like \parbox{width}.

enter image description here

  • +1 and have my image as you beat me by a second or two:-) – David Carlisle Jun 25 '13 at 20:04
  • Great; thank you! That was easy. :) – Svend Tveskæg Jun 25 '13 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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