tirenweb
tirenweb

Reputation: 31709

Is there any way in Eclipse to format a code that contains divs in the way Netbeans do it?

Is there any way in Eclipse to format a code that contains divs in the way Netbeans do it?

I mean, if you have this in Netbeans:

<div>
</div>
</div>
<div>

and you format it (Source > Format), it becomes this way:

<div>
    <div>
    </div>
</div>

Upvotes: 2

Views: 2586

Answers (2)

VonC
VonC

Reputation: 1323823

Yes, you can if:

  • you have the WTP plugin (Web Tools Platform) installed
  • you have unselected the "Automatically remove End tags" option, then you have the formatting experience you want.

http://web.archive.org/web/20130402053202/http://img534.i_mageshack.us/img534/324/eclipsexmlempty.png

Upvotes: 1

2ndkauboy
2ndkauboy

Reputation: 9377

The shortcut you'll need is: CTRL + SHIFT + F

That works for HTML, CSS, PHP, XML, JS and so on. But you need to have a PHP, HTML editor/plugin like Aptana, PDT or WTP.

Upvotes: 2

Related Questions