Is it possible to make a table as this in a \begin{tabular}...\end{tabular} kind of thing? I didn't even really know what to search for, so I didn't find anything on the internet. And a solution without using tikz would be greatly appreciated as I struggle to understand what's going on in tikz.

Thanks for any help!

Cross table

New contributor
Fin is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • Welcome to TeX SX! You don't need a hammersledge like tikz for that. The blkarray package can do it. – Bernard May 4 at 14:26

Just use multirow.

    \caption{Multi-row table}
    \multirow{2}{*}{\textbf{X}} & $a_1$ & & 12 & 34\\\cline{2-4}
    & $a_2$ & & & 63\\\cline{2-4}     
    \multicolumn{1}{c}{}& \multicolumn{1}{c}{$\sum$} & \multicolumn{1}{c}{55} & \multicolumn{1}{c}{42} & \multicolumn{1}{c}{97}\\     


image of table


With {NiceMatrix} of the package nicematrix.



               &      & \Block{1-2}{Y} \\
               &      & b_1 & b_2 & \sum \\
\Block{2-1}{X} & a_1  &     & 12  & 34 \\
               & a_2  &     &     & 63 \\
               & \sum & 55  & 42  & 97 \\


You need several compilations (because nicematrix uses PGF/Tikz nodes under the hood).

Output of the above code

Your Answer

Fin is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.