# Multirow and multicolum memoir

I am trying to implement a table given in the snapshot. Firstly, I just want to draw a multirow, as it is shown in the image.

\documentclass[12pt, a4paper,twoside]{memoir}
\begin{document}
\definecolor{c1}{rgb}{0.30980, 0.50588, 0.73725}
\definecolor{c2}{rgb}{0.82353, 0.87843, 0.92941}

\setlength{\arrayrulewidth}{1pt}
\setlength{\extrarowheight}{1.0pt}
\begin{table}[H]   % added on 12172013 for caption and label
\centering
\caption{Table}
\label{tb32b}
%\arrayrulecolor{white}
\begin{tabular}{|p{4.5em}|p{3.8cm}|p{7cm}|l|}
\rowcolor{c1}
\multirow{4}{*}{\textcolor{white}{Measure}}
& \multicolumn{2}{l|}{\multirow{4}{*}{\textcolor{white}{Description}}} &
\multirow{4}{*}{\textcolor{white}{NO.}}  \\
\hline
\arrayrulecolor{white}

\rowcolor{c2}
\multirow{4}{*}{Orientation-based}  & \multicolumn{2}{p{11.25cm}|}{The first orientatiofdsafsafsadfsdafdsfasdfdasfdsafasdfsdafdsaffsdafasdt.}    & \multirow{2}{*}{$M_8$}    \\
\rowcolor{c2}
& \multicolumn{2}{p{11.25cm}|}{The second osafdsafsdafasdfsda the sadfdsas of the misdafdsa points.}      & \multirow{2}{*}{$M_9$} \\
\hline

\rowcolor{c2}
\multirow{4}{*}{Pair-based} & Equ1 &  \multirow{4}{*}{sdafdsafasdfdsafasdfdsfasdfdsafdsafdsafasdfdsafasdfasdfsadfasdfsadfsadfasdfdsafdsafdsafdasfdsafdsafasdfasdfsadafdas}  & \multirow{4}{*}{$M_{10\_13}$} \\
\cline{2-3}
& Equ2 & & \\
& Equ3 & & \\
&  Equ4 & & \\
\hline
\end{tabular}
\end{table}
\end{document}


I found a thread but I cannot modifiy it successfully. The URL is Formatting of Tables in Latex, using multirow and multicolumn together

And then I have a new snapshot of my code. This one is closer to the expected table. But row line between M8 and M9 fail to display, and row colors of the last three rows were not showed.

• Please provide a proper code example, there are no \begin{document}, no packages defining colors etc. Jan 6 '14 at 15:28
• And where does the color support come from? What exactly is it you want us to help with? Jan 6 '14 at 16:00
• Hello, daleif.Actually, the code can not be compiled. Jan 6 '14 at 16:01
• anyone help? 3 more to go Feb 3 '14 at 11:27

You can use nested tabulars. Look for a "big" tabular row and use the m column specifier:

\documentclass[12pt,a4paper,twoside]{memoir}
\pagestyle{empty}% for cropping
\usepackage[table]{xcolor}
\usepackage{tabularx,caption}
\usepackage[raggedrightboxes]{ragged2e}
\definecolor{c1}{rgb}{0.30980, 0.50588, 0.73725}
\definecolor{c2}{rgb}{0.82353, 0.87843, 0.92941}

\renewcommand\tabularxcolumn[1]{m{#1}}
\newcommand\TABstack[1]{\tabular{@{}p{\linewidth}@{}}#1\endtabular}

\begin{document}

\noindent
\begin{minipage}{\linewidth}
\captionof{table}{Table}\label{tb32b}
\arrayrulecolor{white}\def\arraystretch{1.4}
\begin{tabularx}{\linewidth}{|m{5em}|X|m{7em}|}
\rowcolor{c1}
\textcolor{white}{Measure}
& \textcolor{white}{Description}
&   \textcolor{white}{NO.}  \\\hline

\rowcolor{c2}
\shortstack[l]{Orientation-\\based}
& \TABstack{The first orientation-based measure is the number of empty bins in the t.\\\hline
The second one is defined as the variance in the orientations of points.}

& \TABstack{$N_i$ is the number of detected\\ $N_i$\newline~} \\\cline{2-2}
\end{tabularx}
\end{minipage}

\end{document}


# Remarks

You have to use the \hhline hack to get the partial \hline.

Next time, please include all the packages need to typeset in your MWE.

# Implementation

\documentclass[12pt,a4paper,twoside]{memoir}
\pagestyle{empty}% for cropping
\usepackage{colortbl,multirow,hhline,mathtools}
\usepackage[raggedrightboxes]{ragged2e}
\DeclareMathOperator{\mean}{mean}
\DeclareMathOperator{\std}{std}
\newcommand*{\MFT}{\mathrm{MFT}}
\newcommand*{\NR}{\mathrm{NR}}
\newcommand*{\NC}{\mathrm{NC}}
\definecolor{c1}{rgb}{0.30980, 0.50588, 0.73725}
\definecolor{c2}{rgb}{0.82353, 0.87843, 0.92941}
\begin{document}
\begin{table}
\centering
\caption{Table}
\label{tb32b}
\arrayrulecolor{white}
\begin{tabular}{|p{0.2\textwidth}|p{0.3\textwidth}|p{0.3\textwidth}|l|}
\rowcolor{c1}
\textcolor{white}{Measure}                                    & \multicolumn{2}{c|}{\textcolor{white}{Description}}               & \textcolor{white}{NO.}  \\
\hline
\rowcolor{c2}
& \multicolumn{2}{c|}{$N_i$}                                        &                         \\
\hhline{|>{\arrayrulecolor{c2}}-|>{\arrayrulecolor{white}}-|>{\arrayrulecolor{white}}-|>{\arrayrulecolor{white}}-|}% \hhline hack
\rowcolor{c2} \multirow{-2}{0.2\textwidth}{Orientation-based} & $N_i$ is the number of detected &                                 &                         \\
\hline
\rowcolor{c2}
Mean value of FT                                              & $\mean(\MFT_i)$                 & $\MFT_i$ is a linear            & $M_2$                   \\
\hline
\rowcolor{c2}
Standard Deviation of $\MFT_i$                                & $\std(\MFT_i)$                  & The save to above.              & $M_3$                   \\
\hline
\rowcolor{c2}
in a Rectangle Region                                         & $\NR_i$                         & $\NR_i$ is  the number of detec & $M_4$                   \\
\hline
\rowcolor{c2}
a circle Region                                               & $\NC_i$                         & $\NC_i$ is  the number o        & $M_4$                   \\
\hline
\end{tabular}
\end{table}
\end{document}


# Output

• For the second row in the table, how can I integrate two columns into one column and centering the first column as it is shown in the attachment. Use {c} instead? Jan 7 '14 at 8:24
• @user18441 See my updated answer. Feb 3 '14 at 15:30