Wednesday, 7 August 2013

Automatic vertical alignement of multirow cells

Automatic vertical alignement of multirow cells

I have this MWE
\documentclass{article}
\usepackage{multirow}
\usepackage{bigstrut}
\setlength{\bigstrutjot}{2pt} % height added by \bigstrut
\usepackage{tabu}
\tabulinesep=1.5pt % ensures some offset between cell content and border
\begin{document}
\begin{tabu}{|c|c|}
\hline
bigstrut \bigstrut & \\\cline{1-1}
ordinary & \multirow{-2}{*}{Multirow} \\\hline
\shortstack{short \\ stack} & \\\cline{1-1}
ordinary & \multirow{-2}{*}{Multirow} \\\hline
ordinary & \\\cline{1-1}
$x=\int_0^\infty\frac{a}{b}$ & \multirow{-2}{*}{Multirow} \\\hline
ordinary & \\\cline{1-1}
$\displaystyle x=\int_0^\infty\frac{a}{b}$ & \multirow{-2}{*}{Multirow}
\\\hline
\end{tabu}
\end{document}
which shows some cases where content of multirow cells is not exactly
where it should be.

I guess a lot of people are familiar with this issue, as I've seen a dozen
of work-arounds. However all of them required some fine-tuning like
[fixup].
I've found a package called makecell, which partially makes what I want.
Still it has flaws. It won't work for multi-line multirow cells and makes
problems with colortbl package I use for bg colour (multirow has to be
defined in the first row).
Do you have any ideas on how automatic vertical alignement of multirow
cell could be achieved?

No comments:

Post a Comment