How do I add a footer in a table
You can't.
Tables are not designed for data *presentation*. They are designed for
data *storage*. If you want headers, footers, totals, subtotals, etc.
create a Report based on your table, and do the presentation work in
the Report, where it belongs.