Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Want cell padding in table layout

Tags:

extjs

extjs4

I would like to have some padding between my components. Currently my form looks like this :

enter image description here

If I want to have 5 pixel spacing between all my components is there an easy way to do this? If I put margin and padding values at the panel level, then this affects only the panel itself, rather than its containing elements :

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 *'
    }
]

I could put padding for each individual component but that seems like a pain.

like image 890
Oliver Watkins Avatar asked Dec 08 '25 20:12

Oliver Watkins


1 Answers

Ah just figured it out with some moore googling. You need to set style padding on the tdAttrs value for the layout.

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

Anyone know of a better solution?

like image 143
Oliver Watkins Avatar answered Dec 10 '25 22:12

Oliver Watkins