Go to Window->Preferences->Java->Code Style->Formatter. Create new formatter.
Eclipse HTML Editor is an Eclipse plugin for HTML , JSP , and XML editing and has the following features: HTML , JSP , XML , CSS , DTD , and JavaScript colored highlighting.
To improve the formatting of your HTML source code, you can use the Format Document command Ctrl+Shift+I to format the entire file or Format Selection Ctrl+K Ctrl+F to just format the selected text.
To format your whole script: Open the required file. Go to Source | Format Document or press Ctrl+Shift+F.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With