2014-09-12 75 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' 
        }, 

任何人都知道更好的解決方案嗎?

相關問題