0

So I have a table where I just can't get multirow to work and i don't know what I am doing wrong. It's a pretty long table so bear with me.

\begin{table}[H]
\caption{Utflöden}
\label{Utflöde}
\begin{center}
\begin{tabular}{|c|c|c|c|}
\hline
    \rowcolor{white} Ström & Ämne & Storlek $[kg/h]$ & Viktade värde \\\hline
    \multirow{9}{0.1\linewidth}{12} & Vatten &6089,12 &5841,87 \\\cline{2-4}
    & Syrgas  & 0,09 & 0,086 \\\cline{2-4}
    & Eten & 0,0048 & 0,0046 \\\cline{2-4}
    & HCl & 425,34 & 408,07 \\\cline{2-4}
    & EDC (Prod.) & 118,7 & 113,88\\\cline{2-4}
    & Kloretan & 121,31 &116,38 \\\cline{2-4}
    & $CO_2$ & 2,4 & 2,30 \\\cline{2-4}
    & Trikloretan & 18,22 & 17,48 \\\cline{2-4}
    & NaCl & 255,71 & 245,33 \\\hline
    \multirow{7}{0.1\linewidth}{16} & Syrgas & 1,17 & 1,12 \\\cline{2-4}
    & Eten & 3,21 & 3,08 \\\cline{2-4}
    & HCl & 3,47 & 3,33 \\\cline{2-4}
    & EDC (Prod.) & 10423,23 & 10000 \\\cline{2-4}
    & Kloretan & 112,19 & 107,63 \\\cline{2-4}
    & $CO_2$ & 52,17 & 50,05 \\\cline{2-4}
    & Trikloretan & 485,2 & 565,50 \\\hline
    \multirow{8}{0.1\linewidth}{17} & Vatten & 1,91 & 1,83 \\\cline{2-4}
    & Syrgas & 371,17 & 356,10 \\\cline{2-4}
    & Eten & 51,32 & 49,24 \\\cline{2-4}
    & HCl & 20,53 & 19,70 \\\cline{2-4}
    & EDC (Prod.) & 43,61 & 41,84 \\\cline{2-4}
    & Kloretan & 20,29 & 19,47 \\\cline{2-4}
    & $CO_2$ & 610,02 & 585,25 \\\cline{2-4}
    & Trikloretan & 0,2 & 0,19 \\\cline{2-4}
\end{tabular}
\end{center}
\end{table}

I have \usepackage{multirow} and also \rowcolors{2}{color1}{color2} if that makes any difference where color1 and color2 are just some grey colors. I get the outcome looking like this with no hint of \multirow working at all.

enter image description here

Joey
  • 21
  • (1) welcome, (2) as always on this site, please provide a full minimal example instead of a sniplet like this. Then it is easier for others to copy and test your code without having to add/change anything. BTW: It is probably not a good idea to use non-ascii chars in a \label – daleif Mar 05 '18 at 15:15
  • Also you might want to look up the mhchem package, it helps when you want to typeset compound names so \ce{CO2} is typeset as CO₂ (with upright CO in contrast to your image) – daleif Mar 05 '18 at 15:16
  • How do you want the output to look? What are the problems with the current output? Also, could you try to reproduce the problem with a smaller table (for example six rows with three multirows)? And, as @daleif said, please provide a compilable document with a documentclass and relevant packages. – Marijn Mar 05 '18 at 15:20

2 Answers2

0

I found the answer. It had to do with the alternating colors. Since they are added after the \multirow line they would be placed over and hide the text. By changing the location of \multirow and making the value negative I got the right result (\multirow{-9}{*}{12})

Joey
  • 21
0

Duplicate of this:

\rowcolor for a \multirow

Solution:

\documentclass[a4paper, titlepage, 12pt, oneside]{report}
\usepackage[table]{xcolor}
\usepackage{multirow}
\usepackage{float}

\begin{document}
  \begin{table}[H]
\caption{Utflöden}
\label{Utflöde}
\begin{center}
  \rowcolors{2}{gray!50}{gray!20}
\begin{tabular}{|c|c|c|c|}
  \hline
    \rowcolor{white} Ström & Ämne & Storlek $[kg/h]$ & Viktade värde \\\hline
    %\multirow{9}{0.1\linewidth}{12}%moved down
    & Vatten &6089,12 &5841,87 \\\cline{2-4}
    & Syrgas  & 0,09 & 0,086 \\\cline{2-4}
    & Eten & 0,0048 & 0,0046 \\\cline{2-4}
    & HCl & 425,34 & 408,07 \\\cline{2-4}
    & EDC (Prod.) & 118,7 & 113,88\\\cline{2-4}
    & Kloretan & 121,31 &116,38 \\\cline{2-4}
    & $CO_2$ & 2,4 & 2,30 \\\cline{2-4}
    & Trikloretan & 18,22 & 17,48 \\\cline{2-4}
    \multirow{-9}{0.1\linewidth}{12}%Placed here with -9
    & NaCl & 255,71 & 245,33 \\\hline
    %\multirow{7}{0.1\linewidth}{16}
    & Syrgas & 1,17 & 1,12 \\\cline{2-4}
    & Eten & 3,21 & 3,08 \\\cline{2-4}
    & HCl & 3,47 & 3,33 \\\cline{2-4}
    & EDC (Prod.) & 10423,23 & 10000 \\\cline{2-4}
    & Kloretan & 112,19 & 107,63 \\\cline{2-4}
    & $CO_2$ & 52,17 & 50,05 \\\cline{2-4}
    \multirow{-7}{0.1\linewidth}{16}& Trikloretan & 485,2 & 565,50 \\\hline
    %\multirow{8}{0.1\linewidth}{17}
    & Vatten & 1,91 & 1,83 \\\cline{2-4}
    & Syrgas & 371,17 & 356,10 \\\cline{2-4}
    & Eten & 51,32 & 49,24 \\\cline{2-4}
    & HCl & 20,53 & 19,70 \\\cline{2-4}
    & EDC (Prod.) & 43,61 & 41,84 \\\cline{2-4}
    & Kloretan & 20,29 & 19,47 \\\cline{2-4}
    & $CO_2$ & 610,02 & 585,25 \\\cline{2-4}
    \multirow{-8}{0.1\linewidth}{17}& Trikloretan & 0,2 & 0,19 \\\hline
\end{tabular}
\end{center}
\end{table}
\end{document}

Explanation on the link

koleygr
  • 20,105