Add footer to table and fix right align bugs