2

I want to create a table just like this. How do I go about it? Do I use tables? A combination of tables and tikz maybe? enter image description here

1 Answers1

1

Something like this? Observe: no TikZ code whatsoever.

enter image description here

\documentclass{article} % or some other suitable document class
\usepackage[]{geometry} % set page parameters suitably
\usepackage{array}      % for "w" column type
\usepackage{calc}       % for "\widthof" macro
\newcommand{\mycell}[2]{%
  \begingroup
  \setlength\tabcolsep{2pt}%
  \begin{tabular}{ wr{\widthof{600}} c wr{\widthof{600}} } 
      & & \multicolumn{1}{|r|}{#1} \\
      \cline{3-3}
      #2 & &  
  \end{tabular}%
  \endgroup} 
\begin{document}

\begin{table} \centering \setlength\tabcolsep{5pt} \setlength\extrarowheight{2pt} \begin{tabular}{|c*{7}{|r}} \hline \multicolumn{1}{|c}{} & \multicolumn{6}{c}{Distribution centers} & \ \hline sources & 3 & 4 & 5 & 6 & 7 & 8 & SUPPLY \ \hline 1 & \mycell{16}{} & \mycell{10}{} & \mycell{12}{300} & \mycell{100}{} & \mycell{100}{} & \mycell{100}{} & 300 \ \hline 2 & \mycell{15}{0} & \mycell{14}{300} & \mycell{17}{} & & & & 300 \ \hline 3 & \mycell{0}{600} & & & & & & 600 \ \hline 4 & \mycell{100}{} & & & & & & 600 \ \hline 5 & \mycell{100}{} & & & & & & 600 \ \hline DEMAND & 600 & 600 & 600 & 200 & 100 & 300 & \ \hline \end{tabular} \caption{Final solution table} \label{tab:fst} \end{table} \end{document}

Mico
  • 506,678