2014-09-12 76 views
3

我想在我的组件之间填充一些填充。目前我的形式如下:希望单元格在表格布局中填充

enter image description here

如果我想有我所有的组件之间5像素间距是有一个简单的方法来做到这一点?如果我把margin和padding值在面板的水平,那么这只会影响面板本身,而不是它包含的元素:

margin: '5 5 5 5', 
padding: '15', 
xtype:'panel', 
layout: { 
    type: 'table', 
    columns: 3 
}, 
items: [ 
    { 
     xtype:'label', 
     text:'Name *' 
    },{ 
     xtype:'label', 
     text:'Version *' 

    }, { 
     xtype:'label', 
     text:'Sprache *' 
    }, { 

     xtype:'textfield', 
     text:'Name *' 

    }, { 
     xtype: 'textfield', 
     text: 'Version *' 
    }, { 
     xtype: 'combobox', 
     text: 'Sprache *' 
    } 
] 

我可以把填充每个单独的组件,但是这似乎是一个痛苦。

回答

2

啊刚刚找出了一些moore谷歌搜索。您需要为布局的tdAttrs值设置样式填充。

    layout: { 
         type: 'table', 
         columns: 3, 
         tdAttrs: { style: 'padding: 10px;' } 
//      padding: '65' 
        }, 

任何人都知道更好的解决方案吗?

相关问题