rename table & tr variables
reindent, and remove surplus span from formula text