I'm trying to put a \multicolumn within a \multirow environment in the following manner:
\documentclass{article}
\usepackage{multirow}
\usepackage{array}
\usepackage{mwe}
\begin{document}
\begin{tabular}{|p{.03\textwidth}|p{.73\textwidth}|p{.03\textwidth}|p{.15\textwidth}|}
Test1 & Test2 & Test3 &
\multirow{1}{*}{\multicolumn{1}{m{\linewidth}}{\includegraphics[width=\linewidth]
{example-image}}}
\end{tabular}
\end{document}
For clarification, I have multiple rows in the table (6) and the multirow spans those 6 rows. The inner multicolumn is so that the image is centered within the multirow. However, I get the error:
Misplaced \Omit
Does anyone have any idea why this is happening? Thanks!
Update:
See Christian's answer for fixing the error. But latex was still having trouble centering the picture vertically when one of the rows was had multi line text. As a workaround, I increased the number of rows the multirow is spanning even though there are actually 6. This is admittedly an ugly hack and one I'm not particularly happy with, but it works for now. If anyone has any better solution, I'm open to suggestions.
Update 2:
Ok so update 2. See Christian's revised solution and comments for two possible ways to get around this problem. Thanks Christian for all the help!
\multirow
and\multicolumn
statements.\multicolumn
outside, then\multirow
inside. I suppose, the lines with 'Test1' etc. should be in multirow(s) as well.