PDA

View Full Version : insert padding in table layout elements



rnel
31 Jan 2013, 3:24 AM
Hi,

Does somebody know how to define padding and/or margin for elements contained in a table layout (in a panel), i've tried setting padding and margin on the panel, tdAttrs on the table, but none seems to work. Does anyone knows how to set those ?

Thanks.

sriram139
1 Feb 2013, 2:54 PM
Try setting padding and margin configs in the panels.
Sample working code:


Ext.onReady(function () {
Ext.create('Ext.panel.Panel', {
title: 'Table Layout',
width: 300,
height: 150,
layout: {
type: 'table',
columns: 3
},
defaults: {
bodyStyle: 'padding:20px'
},
items: [{
//with padding
html: 'Cell A content',
padding: '10 10 10 10'
}, {
//with margin
html: 'Cell B content',
margin: '10 10 10 10'
}, {
//no padding... no margin
html: 'Cell C content',
cellCls: 'highlight'
}],
renderTo: Ext.getBody()
});
});