Got totals to update and display at end of table

It took awhile, because when you have the template in a div in the
table, it just decides to replace it with a bunch of whitespace for no
apparent reason.  However, I managed to get it working in there.