Eclipse html:不缩进某些标签 [英] Eclipse html: Doesn't indent on some tags

查看:261
本文介绍了Eclipse html:不缩进某些标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,Eclipse似乎认为, < div> < td> 标签不是缩进的。



Ctrl + Shift + F缩进以下HTML:

 < div> 
< div>
< table>
< tr>
< td> test< br />
test2
< h1> test 2< / h1>
< div>测试< br />
test2< / div>
< table>
< tr>
< td>
< h1>再次< / h1>
< / td>
< / tr>
< / table>
< / td>
< / tr>
< / table>
< / div>
< / div>任何人都不知道如何关闭这个逻辑(我希望所有的标签缩进!),或者自定义?

解决方案

我会给你一个如何在Aptana做的例子。由于它基于Eclipse - 它将或多或少相同:



窗口>首选项> Aptana(或Eclipse)>编辑器> HTML>格式化>要编辑,保存该配置文件作为新的配置文件,并且编辑>新行>这里的所有内容应该是自解释的。



示例截图: http://img10.imageshack.us/img10/6643/aptanaeclipse.jpg



如果您无法找到菜单项,只需在首选项对话框窗口左上角进行筛选搜索。


For some reason, Eclipse seems to think that e.g. <div> and <td> tags aren't indenting-worthy.

Ctrl+Shift+F indents the following HTML as such:

<div>
<div>
<table>
    <tr>
        <td>test<br />
        test2
        <h1>test 2</h1>
        <div>testing<br />
        test2</div>
        <table>
            <tr>
                <td>
                <h1>again</h1>
                </td>
            </tr>
        </table>
        </td>
    </tr>
</table>
</div>
</div>

Anyone have any idea of how to turn this logic off (I want all tags to indent!), or customize it?

解决方案

I'll give you an example of how to do it in Aptana. Since it's based on Eclipse - it will be more or less the same:

Window > Preferences > Aptana (or Eclipse) > Editors > HTML > Formatting > To edit, save the profile as a new one, and Edit > New lines > Everything in here should be self explanatory.

A sample screenshot: http://img10.imageshack.us/img10/6643/aptanaeclipse.jpg

In case you struggle to find a menu item, just do a filter search on the top left of the Preferences dialog window.

这篇关于Eclipse html:不缩进某些标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆