Slartibartfast
Slartibartfast

Reputation: 1623

How can I make webstorm format my html the way eclipse does?

That is instead of

<table>
<tr>
<td>content</td>
</tr>
<table>

I would like

<table>
   <tr>
     <td>content</td>
   </tr>
</table>

I've tried reformat, but it always gives me the top result. I've tried the call to action and went into the format settings, but it didn't change anything.

This seems trivial, but I have a huge unformatted .jsp file and it is impossible to work with in WebStorm.

Upvotes: 9

Views: 14761

Answers (2)

lena
lena

Reputation: 93868

Make sure that <table> and <tr> are not listed in Settings/Code Style/HTML/Other/Do not indent children of: option - this should help when formatting HTML. But note that it won't work for JSP - actually there is no way to get formatting working for jsp files in WebStorm. See WEB-527

Upvotes: 21

Safiresh
Safiresh

Reputation: 199

On the Main menu-->choose Code-->Reformat Code or press Ctrl+Alt+L.

In the Reformat Code dialog box, specify the reformatting scope: The current file. Selected text. All files in the current directory, including or omitting subdirectories. You can also include optimizing imports, by selecting the Optimize imports check box, which is enabled for the current directory only. Click Run.

Upvotes: 9

Related Questions