1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    38
    Answers
    3
    Vote Rating
    0
    rnel is on a distinguished road

      0  

    Default Unanswered: insert padding in table layout elements

    Unanswered: insert padding in table layout elements


    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.

  2. #2
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    41
    Answers
    6
    Vote Rating
    2
    sriram139 is on a distinguished road

      0  

    Default Use padding and margin configs of Panel

    Use padding and margin configs of Panel


    Try setting padding and margin configs in the panels.
    Sample working code:

    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()
        });
    });

Thread Participants: 1