0

I am still new to LaTex, and I am creating a big table and try to fit it into one page.

Here is my part of the Tex, and I keep received error messages like the image attached.

Could you please kindly help me what has gone wrong and how would I correct it? What does this error mean? Is there anything wrong in my Tex?

Thanks in advance!

\begin{table}[ht]
    \caption{Test Statistic}
    \begin{tblr}{
            @{}|c|c|c|c|c|X[c,valign=b]X[c,valign=b]X[c,valign=b]@{}
        }
        \hline
        \hline
Test Type & Situations & $H_0$ & Test Statistics & Critical Value\\
        \hline
        
        
        \SetCell{r=5,c=1} Mean & {A \\ B} & C & D & E\\
        

        \cline{2-5} & {A \\ B} & C & D & E\\

        
        
\cline{2-5} &
    {A \\ B} & C & D & E\\

        \hline
\end{tblr}
\end{table}

improvement opportunity of my code

Susie Qin
  • 1
  • 1

1 Answers1

0

Remove the empty lines from your table. Empty lines serve a purpose (end of paragraph), you should not randomly insert them into your code.

\documentclass{article}
\usepackage{tabularray}

\begin{document}

\begin{table}[ht]
    \caption{Test Statistic}
    \begin{tblr}{
            @{}|c|c|c|c|c|X[c,valign=b]X[c,valign=b]X[c,valign=b]@{}
        }
        \hline
        \hline
Test Type & Situations & $H_0$ & Test Statistics & Critical Value\\
        \hline
        \SetCell{r=5,c=1} Mean & {A \\ B} & C & D & E\\
        \cline{2-5} & {A \\ B} & C & D & E\\
\cline{2-5} &
    {A \\ B} & C & D & E\\
        \hline
\end{tblr}
\end{table}

\end{document}

enter image description here