How to format html files in Eclipse?
go to Window --> preferences --> Web --> HTML files --> Editor
.
In the Inline Elements section, select all the elements that you don't want eclipse to inline(continue with same line).
Click Apply and then Ok.
Now re format using ctrl + shift + f
.
go to Window --> preferences --> Web --> HTML files --> Editor.
Make sure "Indentation Size" is not set to zero.
That's what did it for me.
http://eclipsetidy.sourceforge.net/
You can specify your formatting preferences too: http://eclipsetidy.sourceforge.net/?act=preferences