add total option for table that adds a final row that is a sum of previous rows
add invert option for table