Table: Can I shift a column by half the height of a row?
\documentclass[a4paper]{article}
\usepackage{collcell,array}
\newcommand{\shiftdown}[1]{\smash{\raisebox{-.5\normalbaselineskip}{#1}}}
\newcolumntype{C}{>{\collectcell\shiftdown}c<{\endcollectcell}}
\begin{document}
\begin{tabular}{cC}
A & \multicolumn{1}{c}{ratio}\\
\hline
3 &2\\
6 &3\\
18
\end{tabular}
\end{document}
The \multicolumn{1}{c}{...}
is necessary to avoid applying the shift also to the heading.
\usepackage{booktabs}
\usepackage{collcell}
\newcommand*{\movedown}[1]{%
\smash{\raisebox{-1ex}{#1}}}
\newcolumntype{q}{>{\collectcell\movedown}r<{\endcollectcell}}
% (for "quotient")
\begin{document}
\begin{tabular}{rq}
\toprule
A & \multicolumn{1}{l}{ratio}\\
\midrule
3 & 2\\
6 & 3\\
18 \\
\bottomrule
\end{tabular}
The key part here is that \raisebox
moves the number down and \smash
stops it from just expanding the row (as far as the table is concerned the number takes up no space at all). Then we apply it to the whole column at once using Martin Scharrer's collcell
(which loads array
behind the scenes), and use \multicolumn
to stop the column title from going awry.
Using booktabs
is just to make it look prettier.
(I'll also note that there are probably better ways to code the shift distance than hard-coding it as -1ex!)