eclipse 如何更改eclipse html格式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18418230/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to change eclipse html formatting
提问by Lena Bru
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 理解这一点?
回答by ali akbar azizkhani
回答by RoiEX
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 相比,几乎没有可用的选项,但也许您可以弄清楚该怎么做。
回答by Khaled Obaid
You can find the answer here how to turn off break line in eclipse
您可以在此处找到如何在 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.
转到窗口->首选项->Java->代码样式->格式化程序。创建新的格式化程序。单击编辑,然后选择选项卡换行并将换行策略设置为不换行。