score:124

Accepted answer

if you press ctrl + i it will just format tabs/whitespaces in code and pressing ctrl + shift + f format all code that is format tabs/whitespaces and also divide code lines in a way that it is visible without horizontal scroll.

score:1

ctrl+shift+f formats the selected line(s) or the whole source code if you haven't selected any line(s) as per the format specified in your eclipse, while ctrl+i gives proper indent to the selected line(s) or the current line if you haven't selected any line(s). try this. or more precisely

the ant editor that ships with eclipse can be used to reformat

xml/xhtml/html code (with a few configuration options in window > preferences > ant > editor).

you can right-click a file then

open with... > other... > internal editors > ant editor

or add a file association between .html (or .xhtml) and that editor with

window > preferences > general > editors > file associations

once open in the editor, hit esc then ctrl-f to reformat.

score:6

reformat affects the whole source code and may rebreak your lines, while correct indentation only affects the whitespace at the beginning of the lines.

score:13

ctrl+shift+f formats the selected line(s) or the whole source code if you haven't selected any line(s) as per the formatter specified in your eclipse, while ctrl+i gives proper indent to the selected line(s) or the current line if you haven't selected any line(s).


Related Query

More Query from same tag