2

Consider this example:

\documentclass{article}
\usepackage{makecell}
\usepackage{multirow}
\begin{document}
  \begin{tabular}{|l|r|l|}
    \multirow{2}{*}{Sample} & \multicolumn{2}{c|}{AA}\\
                            & B            & B \\
    sssssssssssssss1        & 111111111    & 22222222222222222222\\
\end{tabular}
\end{document}

The output is

enter image description here

How to centre the multirow horizontally?

1

Redefine column type locally as usual:

\documentclass{article}
\usepackage{makecell}
\usepackage{multirow}
\begin{document}
  \begin{tabular}{|l|r|l|}
    \multicolumn{1}{|c|}{\multirow{2}{*}{Sample}} & \multicolumn{2}{c|}{AA}\\
                            & B            & B \\
    sssssssssssssss1        & 111111111    & 22222222222222222222\\
\end{tabular}
\end{document}

enter image description here

3

Since you load makecell, use \multirowcell – in addition, the syntax doesn't require the width argument:

\documentclass{article}
\usepackage{makecell}
\usepackage{multirow}

\begin{document}

  \begin{tabular}{|l|r|l|}
    \multirowcell{2}{Sample} & \multicolumn{2}{c|}{AA}\\
                            & B & B \\
    sssssssssssssss1 & 111111111 & 22222222222222222222\\
\end{tabular}

\end{document} 

enter image description here

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.