put fd output to footers again and changed html ouput fomatting to put them at top of the table