To make a columned output line up, I often use the same printf
format string in both the headings and the data.
printf "%9s %9s %9s %9s\n" "head1" "head2" "head3" "head4"
... # rest of heading stuff
var1= var2= var3= var4= # null out your data variables
... # do your loop processing to set var1 etc.
printf "%9s %9s %9s %9s\n" "$var1" "$var2" "$var3" "$var4"
Of course you should adjust the %9s in the example to suit your data.