0

I am using sencha touch 2.2.1 . I want to display list items in such way that the title of the item appears on left and its value appears on right. For that I am using itemTpl in which I am using 'table' tag. But the width of the column changes according to the content of the column irrespective of the width given to the columns.

Please find my code below:

   {
            xtype: 'list',
            flex: 1,
            ui: 'round',
            data:[
                { title:'Descriptions', text: 'Change MP3 System'},
                { title:'Priority', text: 'Very High'},
                { title: 'Change Coord', text: 'Eudes Canuto'},
                { title: 'Target Data', text: '20.08.2013'},
                { title: 'LOB', text: 'Electronice'},
                { title: 'Major Change', text: 'Yes'},
                { title:'Risk', text: 'High'}
            ],
            itemTpl: new Ext.XTemplate(
                    '<table style="border:1px solid black; border-spacing: 10px;">',
                        '<tpl for=".">',
                            '<tr>',
                                '<td style="border:1px solid black;padding: 30px;">{title}</td>',
                                '<td style="border:1px solid black;padding: 30px;">{text}</td>',
                            '</tr>',
                        '</tpl>',
                    '</table>'                      
            )
        }

Is there any other way to specify the width of the columns so that the content will get adjusted with equal spacing inside the column irrespective of its contents?

4

1 回答 1

1

在模板中使用表格不是一个好主意。使用 div 格式化您的项目要容易得多。表格用于表格数据(即像电子表格一样),而不是布局。

于 2013-10-08T07:59:13.433 回答