3

I'm trying to add second multirow after the first in a later column of a row. The problem is that the text in that column is not centred as shown in the image below. Additionally, there is only one vertical line closing each row of the table.

enter image description here

Here is the latex code I am using:

\begin{table}
    \centering

    \begin{tabular}{ | l | l | l | l | }
    \hline
    Scene & Type & Time (ms) & Difference  \\ \hline
    \multirow{2}{*}{A} & Type A & \SI{10}{ms} \\
     & Type B & \SI{10}{ms} & \multirow{2}{*}{\SI{0}{ms}} \\ \hline
    \multirow{2}{*}{B} & Type A & \SI{10}{ms} \\
     & Type B & \SI{10}{ms} & \multirow{2}{*}{\SI{0}{ms}} \\ \hline
     \multirow{2}{*}{C} & Type A & \SI{10}{ms} \\
     & Type B & \SI{10}{ms} & \multirow{2}{*}{\SI{0}{ms}} \\ \hline
    \end{tabular}

\end{table}

How would you centre the text in the 'Difference (ms)' column like it is in the 'Scene' column? And fix the missing lines?

Any help would be much appreciated

1 Answer 1

0

Like this?

\documentclass{article}
\usepackage{multirow}
\usepackage{siunitx}
\begin{document}
\begin{table}
    \centering

    \begin{tabular}{ | l | l | l | l | }
    \hline
    Scene & Type & Time (ms) & Difference  \\ \hline
    \multirow{2}{*}{A} & Type A & \SI{10}{\milli\second} & \multirow{2}{*}{\SI{0}{\milli\second}}\\
     & Type B & \SI{10}{\milli\second} &  \\ \hline
    \multirow{2}{*}{B} & Type A & \SI{10}{\milli\second} & \multirow{2}{*}{\SI{0}{\milli\second}}\\
     & Type B & \SI{10}{\milli\second} &  \\ \hline
     \multirow{2}{*}{C} & Type A & \SI{10}{\milli\second} &\multirow{2}{*}{\SI{0}{\milli\second}}  \\
     & Type B & \SI{10}{\milli\second} & \\ \hline
    \end{tabular}

\end{table}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .