I would like to create a table or array with the layout in the figure below, ideally with the nicematrix package wich allows the marginal annotations.
I've read the package documentation and there is maybe a couple of solutions to my question one involves tikz and \CodeAfter, the other \newcolumntype{x}{!{\OnlyMainNiceMatrix{\vrule somelength}}},
I don't know enough of tikz, or how to you get the right somelength, Asking because of exhaustion, no more limit breaks :)
Some ugly latex with NiceArray
$\begin{NiceTabular}{| c c| c c| c c | }[columns-width = 0.5cm,
cell-space-top-limit = 0.15cm, cell-space-bottom-limit= 0.15cm]
\hline
6 & & 8 & & 10 & \\ \cline{1-1} \cline{3-3} \cline {5-5}
& 0 & & 0 & & 150 \\
\hline
7 & & 11 & & 11 & \\ \cline{1-1} \cline{3-3} \cline {5-5}
& 175 & & 0 & & 0 \\
\hline
4 & & 5 & & 12 & \\ \cline{1-1} \cline{3-3} \cline {5-5}
& 25 & & 100 & & 150 \\
\hline
\end{NiceTabular}$
With NiceTabular
\begin{table} \label{lab}
\centering
\begin{NiceTabular}{@{}Wl{2.5cm}|Wl{0.5cm}Wr{0.5cm}|Wl{0.5cm}Wr{0.5cm}|Wl{0.5cm}Wr{0.5cm}|Wl{2.5cm}l@{}}
\toprule
& \Block{2-2}{A} & & \Block{2-2}{B} & &\Block{2-2}{C} & &\Block{2- 2}{D}\\
& & & & & & & &\\
\midrule
\Block{2- 1}{E} & 6 & & 8 & & 10 & & \Block{2- 1}{5}\\
& & -- & & -- & & 15 & &\\ \hline
\Block{2- 1}{F} & 7 & & 11 & & 11 & & \Block{2- 1}{1}\\
& & 175 & & -- & & -- & &\\ \hline
\Block{2- 1}{G} & 4 & & 5 & & 12 & & \Block{2- 1}{2}\\
& & 25 & & 100 & & 5 & &\\ \hline
\Block{2-1}{Demanda} & \Block{2-2}{200} & & \Block{2-2}{100} & &\Block{2-2}{300} & &\Block{2- 2}{600}\\
& & & & & & & &\\
\bottomrule
\end{NiceTabular}
\caption{Cap}
\end{table}


blkarray. – Bernard Sep 19 '20 at 07:48