First of all, since you're doing html, are you trying to keep indenting in the source or do you want the spaces to be shown on the page?
I'll write the solution for both,
If you just want it to be for source indenting then just encase your echo in quotation
Code:
echo "$a <br>"
if you want the spaces to be there for the output of a browser you need to do convert the spaces to html entities. This because of html's way of interpret whitespaces.
Code:
echo "$a <br>" | sed -e "s/ / /g"
Best regards
Fredrik Eriksson