I'm trying to make a table like the one in following image in LaTeX

but I'm unsure how to go about it. I've been using the tabular environment from the booktabs package, but the following code doesn't produce the table correctly. There are breaks in the lines, the lines extend too far, etc.
\documentclass[10pt]{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{ccc|ccccccc}
&&&&&\multicolumn{5}{c}{Capacity j} \\
&&i&0&1&2&3&4&5&6\\
\midrule
&&0&0&0&0&0&0&0&0\\
$w_1 = 3$&$v_1 = 25$&1&0&0&0&25&25&25&25\\
$w_1 = 2$&$v_1 = 20$&2&0&0&20&25&25&45&45\\
\end{tabular}
\end{document}
This produces a table that looks like this:

I know my MWE isn't complete, but I included the necessary code to demonstrate the problems with my current table.
