Even if frowned upon, I'd like to keep the vertical lines. Nevertheless, in the following MWE i get a misalignment in the heading. Once towards the top, once towards the bottom - I added a line in the picture for clarification. Increasing the cell width to keep the heading in one line in the first example does not solve the problem. Question: How do I achieve vertical alignment in tabu-environment across all columns?
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{tabu}
\usepackage{multirow}
\usepackage{array}
\begin{document}
\begin{table}[!htb]
\vspace{2ex}
\centering
{\tabulinesep=1.2mm
\begin{tabu}spread 0pt{|X[1cm]|X[-2.5cm]|X[-2cm]|}\hline\hline
\textbf{Jahr}&\textbf{Plätze insgesamt}&\textbf{Plätze besetzt}\\ \hline
2010&579.564&559.959\\ \hline
\hline
\end{tabu}}
\end{table}
\begin{table}[!htb]
\vspace{2ex}
\centering
{\tabulinesep=1.2mm
\begin{tabu}spread 0pt{|X[1cm]|X[1cm]|X[-1cm]|X[-2cm]|}\hline\hline
\textbf{Jahrgang}&\textbf{Hauptschule}&\textbf{Realschule}&\textbf{Studienberechtigung}\\ \hline
2010 & 4 \% & 67 \% & 29 \% \\ \hline
\hline
\end{tabu}}
\end{table}
\end{document}
EDIT (As I can not yet comment): 1) The link provided by Salim Bou deals with the problem of alignment in multi-line X[m]-tables. I ran across that solution, but the problem outlined here occures even in one-lined (headings of) tables.
2)
The solution provided by gernot works (!) and is quickly to implement but has a drawback I'd like to point out:
In my MWE Jahr
needs a \dstrut
as well, as soon as the table is expanded. Furthermore, I had to use several iterations to identify each column in need of a downward extender - this quickly gets out of hand in a longer document.
3)
The solution of egreg has the additional benefit of allowing to be placed in a \newenvironment
to fix this problem on the fly.
%Mytable with three arguments
%#1 - Label
%#2 - Ref
%#3 - dynamic number of columns
%example for a table with two columns:
%\begin{mt}
% {Number of things in this case over the years}{tab:things_yrs}{2}
%1&2\\ \hline
%3&4\\ \hline
%\end{mt}
\newenvironment{mt}[4]{
\begin{table}[!htb]
\vspace{2ex}
\caption[#1]{#2}
\label{#3}
\centering
\tabulinesep=1.2mm
\begin{tabu}{|*#4{X[-1cm]<{\unskip\strut}|}}\hline\hline}
{\hline\hline
\end{tabu}
\end{table}}