Search code examples
latextabular

Table in LaTeX can't show everything


I am trying to use tabularray in Latex to put all the elements in the array to the center of each cell.

\begin{tblr}{vlines={}, hlines{}}
\hline
& Dog & Car & Bird \\
\hline
\SetCell[r=3]{} \includegraphics[scale=0.075]{Images/Dog/dog0.png} & 
\SetCell[r=3]{} 9.9878e-01 & \SetCell[r=3]{} 1.184e-03 & \SetCell[r=3]{} 3.4918e-05 \\
\hline
\SetCell[r=3]{} \includegraphics[scale=0.075]{Images/Car/car0.png} & 
\SetCell[r=3]{} 1.9827e-06 & \SetCell[r=3]{} 1.000e+00 & \SetCell[r=3]{} 1.2906e-06 \\
\hline
\SetCell[r=3]{} \includegraphics[scale=0.075]{Images/Bird/bird0.png} & 
\SetCell[r=3]{} 2.5124e-05 & \SetCell[r=3]{} 1.5071e-05 & \SetCell[r=3]{} 9.9996e-01 \\
\hline
\end{tblr}

However, I am not getting the whole table. I can only see the first and second row after compile. enter image description here

What have I done wrong?

I think the second row took all the spaces for the third and fourth row. (I'm not sure)


Solution

  • Remove all the \SetCell[r=3]{}:

    \documentclass{article}
    
    \usepackage{graphicx}
    \usepackage{tabularray}
    \usepackage[export]{adjustbox}
    
    \begin{document}
    
    \begin{tblr}{vlines,hlines}
    & Dog & Car & Bird \\
     \includegraphics[scale=0.75,valign=c]{example-image-duck} & 
     9.9878e-01 &  1.184e-03 &  3.4918e-05 \\
     \includegraphics[scale=0.75,valign=c]{example-image-duck} & 
     1.9827e-06 &  1.000e+00 &  1.2906e-06 \\
     \includegraphics[scale=0.75,valign=c]{example-image-duck} & 
     2.5124e-05 &  1.5071e-05 &  9.9996e-01 \\
    \end{tblr}
    
    \end{document}
    

    enter image description here