3

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.

MWE

I guess a lot of people are familiar with this issue, as I've seen a dozen of workarounds. 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 alignment of multirow cell could be achieved?

2

If an alternative tables package is an option, I'd suggest cals:

multirow alignment in calstable

\documentclass{article}
\usepackage{cals}
\usepackage{bigstrut}
\setlength{\bigstrutjot}{2pt}
\begin{document}

\newcommand\incell{%\vfil % uncomment to align middle
Multirow}

\begin{calstable}
%\alignC % uncomment to align center
\colwidths{{3cm}{3cm}}
\brow
  \cell{bigstrut \bigstrut}
  \nullcell{tlr}
\erow
\brow
  \cell{ordinary}
  \nullcell{blr}\spancontent{\incell}
\erow
\brow
  \cell{\shortstack{short \\ stack}}
  \nullcell{tlr}
\erow
\brow
  \cell{ordinary}
  \nullcell{blr}\spancontent{\incell}
\erow
\brow
  \cell{ordinary}
  \nullcell{tlr}
\erow
\brow
  \cell{$x=\int_0^\infty\frac{a}{b}$}
  \nullcell{blr}\spancontent{\incell}
\erow
  \brow
  \cell{ordinary}
  \nullcell{tlr}
\erow
\brow
  \cell{$\displaystyle x=\int_0^\infty\frac{a}{b}$}
  \nullcell{blr}\spancontent{\incell}
\erow
\end{calstable}
\end{document}
  • It looks like I can make an use of your package. Are variable width columns going to be possible any soon? – Paul Aug 7 '13 at 22:05
  • Unfortunately, never. – olpa Aug 8 '13 at 6:47

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.