I'm trying to replicate complicated table (scheme) from Excel:
Cells with numbers (1, 2, …) should be more or less squared. Lines forming right angle around center table are thicker than ordinary borders (not shown here).
I can make every table separately, but have no idea how to combine them together (with some small spaces in horizontal and vertical). Tried with excel2latex macro from ctan, but with no luck.
Thank you in advance.
EDIT
As asked in comments, here are separate tables:
\documentclass{article}
\usepackage{multirow}
\usepackage{graphicx}
\begin{document}
\begin{tabular}{|r|r|r|r|r|}
\hline
1 & 2 & 3 & 4 & 5\\
\hline
1 & 2 & 3 & 4 & 5\\
\hline
1 & 2 & 3 & 4 & 5\\
\hline
1 & 2 & 3 & 4 & 5\\
\hline
1 & 2 & 3 & 4 & 5\\
\hline
\end{tabular}
\begin{tabular}{c|l|r|}
\cline{2-3}
\multirow{5}{*}{\rotatebox[origin=c]{90}{some long text here}} & qwerty 1 & 1 \\[1.5ex]
\cline {2-3}
& qwerty 2 & 2 \\[1.5ex]
\cline {2-3}
& qwerty 3 & 3 \\[1.5ex]
\cline {2-3}
& qwerty 4 & 4 \\[1.5ex]
\cline {2-3}
& qwerty 5 & 5 \\[1.5ex]
\cline{2-3}
\end{tabular}
\begin{tabular}{|r|l|}
\hline
4 & text \\
\hline
3 & text text \\
\hline
2 & text text text \\
\hline
1 & text \\
\hline
\end{tabular}
\begin{tabular}{|r|r|r|r|r|}
\hline
1 & 2 & 3 & 4 & 5 \\
\hline
\rotatebox[origin=c]{90}{abc} & \rotatebox[origin=c]{90}{abc abc} & \rotatebox[origin=c]{90}{abc} & \rotatebox[origin=c]{90}{abc abc} & \rotatebox[origin=c]{90}{abc abc abc} \\
\hline
\multicolumn{5}{c}{long text here 2} \\
\end{tabular}
\end{document}
EDIT 2
I ask this question to draw the attention of advanced users and packges' developers to the fact that people need an easy and robust way to make such complex "visual" tables. Complexity of creating tables makes people away from using LaTeX.
Best Answer
A solution with
{NiceTabular}
ofnicematrix
.The rules of each sub-table are drawn by a command
\Block
(with the keyhvlines
) inserted in top-left cell of the sub-table.The thick rule forming right angle is drawn with Tikz in the
\CodeAfter
after the construction of the tabular (using PGF/Tikz nodes created bynicematrix
under the rows, columns and cells of the array).Answer to the question in the comment
I have non easy solution. I have changed the columns
w{r}{8mm}
in columnsp[r]{8mm}
because, in the columnsp
, it's possible to change the horizontal alignement with\RowStyle{\centering}
. However, that creates a problem for the rotatede elements which are now wrapped at 8 mm (maybe I should change that innicematrix
). That's why I have use\makebox
...