For the coursework I'm doing, I needed tables in the following format.

Basically what I need is that framed cells have value holders at four corners. Fiddling around with LaTeX and not being able to produce it myself, I asked our lecturer to send me the source that was used the produce the examples in the course notes. He did, and I tweaked it (added one more column and one more row) to produce what I needed.
The problem is, the alignment within cells is not perfect.

The thing is, I have to put them into the following format:

As you can see, adding the extra bits makes the alignment even worse. I have used \arraystretch{1.4} command to make sure the frame of the "-5" doesn't touch the cell borders. This is transportation problems for computational operations research, by the way, if you were wondering.
So, is there another way of producing this kind of a table that has perfect or at least better alignment?
The code I used that was sent to me by our lecturer is this:
Code: Select all
\begin{tabular}{c|c|c|c|c|c|}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{$13$} & \multicolumn{1}{c}{$9$} & \multicolumn{1}{c}{$15$} & \multicolumn{1}{c}{$15$} & \multicolumn{1}{c}{$12$} \\[2mm]
\cline{2-6}
\multicolumn{1}{c|}{$0$}&
$\begin{array}{lr}12&\\& 13\end{array}$ &
$\begin{array}{lr}15&\\& 9\end{array}$ &
$\begin{array}{lr}13 - \varepsilon &\\& 15\end{array}$ &
$\begin{array}{lr}\varepsilon & \fbox{-5}\\& 10\end{array}$ &
$\begin{array}{lr}&0\\& 12\end{array}$ \\
\cline{2-6}
\multicolumn{1}{c|}{$-3$}&
$\begin{array}{lr}&1\\& 11\end{array}$ &
$\begin{array}{lr}&4\\& 10\end{array}$ &
$\begin{array}{lr}7 + \varepsilon &\\& 12\end{array}$ &
$\begin{array}{lr}3 - \varepsilon &\\& 12\end{array}$ &
$\begin{array}{lr}&0\\& 9\end{array}$ \\
\cline{2-6}
\multicolumn{1}{c|}{$-3$}&
$\begin{array}{lr}&2\\& 12\end{array}$ &
$\begin{array}{lr}&3\\& 9\end{array}$ &
$\begin{array}{lr}&-1\\& 11\end{array}$ &
$\begin{array}{lr}12&\\& 12\end{array}$ &
$\begin{array}{lr}8&\\& 9\end{array}$ \\
\cline{2-6}
\multicolumn{1}{c|}{$-2$}&
$\begin{array}{lr}&2\\& 13\end{array}$ &
$\begin{array}{lr}&5\\& 12\end{array}$ &
$\begin{array}{lr}&0\\& 13\end{array}$ &
$\begin{array}{lr}&-1\\& 12\end{array}$ &
$\begin{array}{lr}10&\\& 10\end{array}$ \\
\cline{2-6}
\end{tabular}