0

I have a table which I am trying to put in a paper but the left hand side is not closed. Can anyone help with this? Also there is a small gap in the middle of the table I would like to get rid of if anyone can help with this it would be greatly appreciated

\begin{table}[ht]
\caption{Tabulated results}
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
\multicolumn{2}{c|}{Channel}& Channel this is \\
 \hline 
    \multicolumn{2}{c}{\multirow{K O}}&
K1\\
    \multicolumn{2}{cl}{}&$K2$\\
    \hline
    \multirow{1Q}&H& r1$\\
   &H2&   r2\\
     &N& r3\\
      &X& $X_{x}$\\
      &X& $X_{y}$\\
    \hline
        \hline
    \multirow{2q}&H& r1\\
   &H&    r2 \\
     &N&  r3\\
     &H3& r4\\
      &X& $X_X$\\
      &X& $X_Y$\\
      &X& $X_Z$\\
    \hline
    DD& rd \\
    \hline
\end{tabular}
\end{center}
\label{tab:multicol}
\end{table}

Any help would be greatly appreciated

1
  • 1
    DD& rd \` only has two cells, you want DD& rd &\` Apr 11, 2020 at 22:52

1 Answer 1

1

Your table has many errors, not just the one @David Carlisle who pointed out in his comment:

  • \multirow has wrong syntax,
  • missed (not paired) one $, it is not clear if are missed at other cell contents (r2, r2 etc)
  • missing vertical lines in \multicolumn commands
  • correct document example (MWE: Minimal Working Example) is:
\documentclass{article}
\usepackage{multirow}

\begin{document}
    \begin{table}[ht]
\caption{Tabulated results}
\label{tab:multicol}
    \centering
\begin{tabular}{|c|c|c|}
    \hline
\multicolumn{2}{|c|}{Channel}    &   Channel this is \\
    \hline
\multicolumn{2}{|c|}{%
    \multirow{2}{*}{K O}}       &   K1              \\
\multicolumn{2}{|c|}{}          &   $K2$            \\
    \hline
\multirow{5}{*}{1Q} &   H       &   $r1$            \\
                    &   H2      &   r2              \\
                    &   N       &   r3              \\
                    &   X       &   $X_{x}$         \\
                    &   X       &   $X_{y}$         \\
    \hline
    \hline
\multirow{7}{*}{2q} &   H       &   r1              \\
                    &   H       &   r2              \\
                    &   N       &   r3              \\
                    &   H3      &   r4              \\
                    &   X       &   $X_X$           \\
                    &   X       &   $X_Y$           \\
                    &   X       &   $X_Z$           \\
    \hline
DD                  &   rd      &                   \\
    \hline
\end{tabular}
    \end{table}
\end{document}

enter image description here

3
  • Well, it is true that the table has many errors but is there a reason to keep them in place? Why is r1 typeset in text mode and r2 in math mode, say, and similarly for K1 and K2 and many other examples? I understand that this is the OP's code but you mention that you fix the mistakes, which I can hardly see.
    – user194703
    Apr 11, 2020 at 23:52
  • 1
    @Schrödinger'scat, well, you can fix all I was missed. I just made code compilable and add missed vertical lines, what was OP question. Other I left to OP.
    – Zarko
    Apr 12, 2020 at 0:07
  • I am not interested in writing an answer if the problem is already solved in the comments.
    – user194703
    Apr 12, 2020 at 0:52

You must log in to answer this question.

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