0

Good day everyone.

I am following an earlier very nice post and have only two questions about the answer given here,

  1. What is the role the * of \multirow{2}{*}{}?

  2. So one version of the Table is this

enter image description here

But...

But if we have an extended longer column obstruction in the \multirow{2}{$\begin{matrix} 5\\5\\5\\5\\5\\5 \end{matrix}$ }{}

shown like this:

enter image description here

Main question: There is a long column in the \multirow{2} with a six of 5 in a column, how can we fix the Table to make it looks like all the six of 5 are all in a single block without interfering with the neighbored lines? How do we fix this?

Here are my minimal templates:

\begin{document}


\centering\renewcommand\arraystretch{1.2}
\begin{tabular}{c|c|c}
\hline
Topic 1 & \multicolumn{2}{c}{Topic 2}\\
\hline
33333 & 44444 & \multirow{2}{*}{55555}\\
\cline{1-2}
aaaaa & bbbbb\\
\hline
aaaaa & \multicolumn{2}{c}{ddddd}
\\
\hline
 \end{tabular}



\centering\renewcommand\arraystretch{1.2}
\begin{tabular}{c|c|c}
\hline
Topic 1 & \multicolumn{2}{c}{Topic 2}\\
\hline
33333 & 44444 & \multirow{2}{*}{$\begin{matrix} 5\\5\\5\\5\\5\\5 \end{matrix}$ }\\
\cline{1-2}
aaaaa & bbbbb\\
\hline
aaaaa & \multicolumn{2}{c}{ddddd}
\\
\hline
 \end{tabular}

\end{document}
wonderich
  • 2,387
  • There are several potential conflicts in your second tabular environment. First, since the column vector of fives contains 6 rows, encasing it in a \multirow{2}{*}{...} directive looks like a mistake. Should it be \multirow{6}{*}{...}? Second, the statement \multicolumn{2}{c}{ddddd} necessarily conflicts with any material that might be in the third column of that row. (Change the directive to \multicolumn{2}{c}{dddddddd} to verify this claim.) Without knowing what you're trying to achieve, it's not possible to give targeted advice. – Mico May 02 '17 at 04:59
  • I just want to have a long {$\begin{matrix} 5\5\5\5\5\5 \end{matrix}$ } stick inside into a block there without interfering with other materials. But that long block only takes two rows (from the left hand side viewpoint (parallel to 33333 44444 and aaaaa bbbbb). – wonderich May 02 '17 at 05:34
  • I'm confused. How can you say that the "long block only takes two rows" when, in fact, it takes six rows (as it's a six-element column vector)? Please clarify. – Mico May 02 '17 at 05:39
  • just because I need to write a huge paragraph there in the two blocks (from the left), but one single "unified" block from the right. – wonderich May 02 '17 at 05:40
  • @Mico, I also confused by the meaning of * of \multirow{2}{*}{}, can I change that to something else? like the Left, Right, Top, Bottom, Center, etc attangement ??? Thanks! – wonderich May 02 '17 at 05:45
  • You can do almost anything... My question remains the same, though: What are you trying to achieve? Can you maybe sketch out the desired layout on a piece of paper and post a scan? – Mico May 02 '17 at 06:10
  • I figured that \begin{minipage} \end{minipage} serve well for my purpose for a long text. – wonderich May 02 '17 at 15:58

1 Answers1

1

* in \multirow{n}{*}{…} means multirow will have the natural width of its contents

For the second table, you simply have to add supplementary lines change the value of n from 2 to 6. Here is a possibility:

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

    \begin{document}


\centering\renewcommand\arraystretch{1.2}
\begin{tabular}{c|c|c}
\hline
Topic 1 & \multicolumn{2}{c}{Topic 2}\\
\hline
33333 & 44444 & \multirow{2}{*}{55555}\\
\cline{1-2}
aaaaa & bbbbb\\
\hline
aaaaa & \multicolumn{2}{c}{ddddd}
\\
\hline
 \end{tabular}
\vspace{1cm}

\centering\renewcommand\arraystretch{1.2}
\begin{tabular}{c|c|c}
\hline
Topic 1 & \multicolumn{2}{c}{Topic 2}\\
\hline
33333 & 44444 & \multirow{6}{*}{$\begin{matrix} 5\\5\\5\\5\\5\\5 \end{matrix}$ }\\%{5\\5\\5\\5\\5\\5}
\cline{1-2}
aaaaa & bbbbb\\
\cline{1-2}
aaaaa & \\
\cline{1-2}
\multicolumn{2}{c|}{}\\
\multicolumn{2}{c|}{}\\
\multicolumn{2}{c|}{}\\
\hline
& \multicolumn{2}{c}{ddddd}\\
\hline
 \end{tabular}

\end{document} 

enter image description here

Bernard
  • 271,350
  • Thanks, Bernard, but you introduce the additional blank new blocks that I do not have, in the Second Table. How do we modify the Second Table to have all the new blanks removed, but keeping all the 5 in a single block. (p.s. The first Table is not necessary.) – wonderich May 02 '17 at 14:44
  • 1
    @wonderich: You didn't specify exactly what you want, and I posted a code with a sensible layout. Could you post a sketch (even a hand drawing) of what you want? It's not very clear to me. – Bernard May 02 '17 at 18:33
  • +1. It's somewhat comforting to notice that I'm not the only one who is more or less in the dark as to the OP's actual objectives... – Mico May 02 '17 at 19:21