I want to use a tabular to list some headlines, that might be quite long or contain linebreaks. The first column is kind of an Index or Key for the second columns content, so i would like to (vertically) center it (and i'll add \midrule
s for readability). To achieve the centering i included the array
-package with its column definition m{2.5em}
. The remaining two columns have fixed widths, too. But – as in the following MWE – the first column is somehow vertically placed top or bottom but not centered.
\documentclass[a4paper,div=calc]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{array,booktabs,calc}
\begin{document}
\begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}%
\toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule%
A &
Lorem ipsum dolor sit amet, consectetur adipisici elit&\\
B & \begin{minipage}[t]{.5\textwidth-6\tabcolsep-8em}
An\\even\\higher\\row\\with\\linebreaks
\end{minipage}&\\
2 & Short Entry &
\\\bottomrule
\end{tabular}
\end{document}
And here's how it looks, as you can see, the first column is not vertically centered (i know in this quick MWE the minipage does not have enough space below).
Any ideas?
Best Answer
use
tabularx
with a redefinition of theX
columntype, then you do not need thecalc
package: