Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change eclipse html formatting

Tags:

When i open an html file in eclipse, after i format it, it looks like this:

<form>             <fieldset>                 <label for="memberName">Login Name:</label> <input type="text"                     name="memberName" id="memberName" value=""                     class="text ui-widget-content ui-corner-all" /> <label                     for="memberPass">Password:</label> <input type="password"                     name="memberPass" id="memberPass" value=""                     class="text ui-widget-content ui-corner-all" />               </fieldset>         </form> 

but i want each tag with all of its attributes on the same line

how do i make eclipse understand that?

like image 340
Lena Bru Avatar asked Aug 24 '13 11:08

Lena Bru


People also ask

Can you edit HTML in Eclipse?

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.

How do I change the format in Eclipse?

Open the required file. Go to Source | Format Document or press Ctrl+Shift+F.

How do I indent HTML code in Eclipse?

go to Window --> preferences --> Web --> HTML files --> Editor. Make sure "Indentation Size" is not set to zero.

How do I arrange indents in Eclipse?

You can use Ctrl + A to select the entire file, then use this shortcut to quickly fix all the indentation. You can also change how Eclipse handles indentation by going to Window > Preferences, then in the left panel, navigate to Java > Code Style > Formatter > Edit... > Indentation.


1 Answers

To change the formatting as usual, go to Window->Preferences->Web->HTML Files->Editor, and remove all inline Elements like this:

enter image description here

like image 146
ali akbar azizkhani Avatar answered Sep 27 '22 22:09

ali akbar azizkhani