1

enter image description hereI am trying to make a table in the same format as above in Miktex yet I keep getting errors such as missing number treated as zero. The table should have some empty blocks I do not know if that is causing the problem.

\begin{align}
\begin{tabular}{ |p{3cm}||p{3cm}|p{3cm}|p{3cm}|p{3cm}|p{3cm}|p{3cm}|  }
 \hline
Test was&  &1 & 2 & 3 & ... & N\\
 \hline
 \multirow{2}{performed} & a_i & + & + $ -  & ... & +\\
 & b_i & +  & - & -  & ...$ + \\
\hline
 \multirow{2}{not performed} & a'_i & ? & ? & ? $ ... & ?\\
 & b'_i & ? & ? & ? $ ... & ?\\
 \hline
\end{tabular}
\end{align}
3
  • if you want help with an error messag eshow the exact error an dprovide a test file, it is very hard to help otherwise. You have only posted a fragment that we can not run but it is very odd, why do you have align with no alignment points around the tabular ? Apr 27, 2021 at 20:30
  • tabular cells are text mode so a_i will be an error, perhaps you intended to use array rather than tabular ? Apr 27, 2021 at 20:30
  • Additionally, both \multirow commands are missing their second argument, which determines the width. You probably want to use \multirow{2}{*}{performed} instead of \multirow{2}{performed}. A sketch of the ecpected output would also really help here. Could you add one to your question?
    – leandriis
    Apr 27, 2021 at 20:37

2 Answers 2

1

I guess the following is at least somewhat close to the expected output:

enter image description here

\documentclass{article}
\usepackage{multirow,array}
\begin{document}

\begin{tabular}{|l||>{$}c<{$}|c|c|c|c|c|} \hline
Test was                       &      & 1 & 2 & 3 & ... & N \\ \hline
\multirow{2}{*}{performed}     & a_i  & + & + & - & ... & + \\
                               & b_i  & + & - & - & ... & + \\ \hline
\multirow{2}{*}{not performed} & a'_i & ? & ? & ? & ... & ? \\
                               & b'_i & ? & ? & ? & ... & ? \\ \hline
\end{tabular}
\end{document}
0

With use of the array and w{c}{<width>} column type:

\documentclass{article}
\usepackage{array, multirow}

\begin{document}
    \[
\setlength\extrarowheight{2pt}
\begin{array}{ |p{7em}||*{6}{w{c}{2em}|} }
 \hline
Test was    &     & 1 & 2 & 3 & \dots & N   \\
 \hline
 \multirow{2}{=}{performed} 
            & a_i & + & + & - & \dots & +   \\
            & b_i & + & - & - & \dots & +   \\
\hline
 \multirow{2}{=}{not performed} 
            & a'_i & ? & ? & ? & \dots & ?  \\
            & b'_i & ? & ? & ? & \dots & ?  \\
 \hline
\end{array}
    \]
\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 .