如何更改eclipse html格式

时间:2023-01-14 16:28:49

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

当我在eclipse中打开一个html文件时,在我格式化后,它看起来像这样:

<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?

我如何让eclipse明白这一点?

3 个解决方案

#1


5  

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

要像往常一样更改格式,请转到Window-> Preferences-> Web-> HTML Files-> Editor,并删除所有内联元素,如下所示:

如何更改eclipse html格式

#2


3  

Under

Window->Preferences->Web->HTML Files->Editor

窗口 - >首选项 - > Web-> HTML文件 - >编辑器

there are some options in terms of HTML formatting.

HTML格式有一些选项。

In comparison to Java, there are almost no options available, but maybe you can figure out on what to do.

与Java相比,几乎没有可用的选项,但也许您可以弄清楚该怎么做。

#3


1  

You can find the answer here how to turn off break line in eclipse

你可以在这里找到如何在日食中关闭断线的答案

Follow these steps to Not wrap.

请按照以下步骤进行不换行。

Go to Window->Preferences->Java->Code Style->Formatter. Create new formatter. Click on edit and then pick tab Line Wrapping and set Line Wrapping policy to Do not wrap.

转到Window-> Preferences-> Java-> Code Style-> Formatter。创建新的格式化程序。单击编辑,然后选择选项卡Line Wrapping并将Line Wrapping策略设置为Do not wrap。

#1


5  

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

要像往常一样更改格式,请转到Window-> Preferences-> Web-> HTML Files-> Editor,并删除所有内联元素,如下所示:

如何更改eclipse html格式

#2


3  

Under

Window->Preferences->Web->HTML Files->Editor

窗口 - >首选项 - > Web-> HTML文件 - >编辑器

there are some options in terms of HTML formatting.

HTML格式有一些选项。

In comparison to Java, there are almost no options available, but maybe you can figure out on what to do.

与Java相比,几乎没有可用的选项,但也许您可以弄清楚该怎么做。

#3


1  

You can find the answer here how to turn off break line in eclipse

你可以在这里找到如何在日食中关闭断线的答案

Follow these steps to Not wrap.

请按照以下步骤进行不换行。

Go to Window->Preferences->Java->Code Style->Formatter. Create new formatter. Click on edit and then pick tab Line Wrapping and set Line Wrapping policy to Do not wrap.

转到Window-> Preferences-> Java-> Code Style-> Formatter。创建新的格式化程序。单击编辑,然后选择选项卡Line Wrapping并将Line Wrapping策略设置为Do not wrap。