You did not tell us what kind of problems you encountered and may be what you expect. Typically, many people - including me - do not answer.
Thus, missing problem description:
1. the template produces a single line for every host. Output of the df command contains one line per filesystem/disk
2. t1 contains lines of data separated by one or more spaces. Separators - I assume - should be single ','
3. the header of df output is include as first line in t1
Solutions
(1) make a second loop in hosts.j2 for the lines in t1
(2) use some expression to replace one or more whitespaces with a ','
(3) not addressed, this remains to you