Eclipse html: Doesn't indent on some tags

stolsvik picture stolsvik · Jan 5, 2011 · Viewed 12k times · Source

For some reason, Eclipse seems to think that e.g. <div> and <td> tags aren't indenting-worthy.

Ctrl+Shift+F indents the following HTML as such:

<div>
<div>
<table>
    <tr>
        <td>test<br />
        test2
        <h1>test 2</h1>
        <div>testing<br />
        test2</div>
        <table>
            <tr>
                <td>
                <h1>again</h1>
                </td>
            </tr>
        </table>
        </td>
    </tr>
</table>
</div>
</div>

Anyone have any idea of how to turn this logic off (I want all tags to indent!), or customize it?

Answer

Rodrigo Almeida picture Rodrigo Almeida · Aug 21, 2013

Window > Preferences > Web > HTML Files > Editors.

Remove what you want to indent of the "Inline Elements" field.

enter image description here

This solved for me.

Hope its better now.