使用Ext.Panel和table布局,我能够按照我想要的方式创建布局.但是,如何更改此代码以便我可以按比例定义宽度和高度?
例如,表格不应该是800像素而是100%的屏幕宽度,每个框不是200像素而是25%.

这是代码:
<script type="text/javascript">
clearExtjsComponent(targetRegion);
var table_wrapper2 = new Ext.Panel({
id: 'table_wrapper2',
baseCls: 'x-plain',
renderTo: Ext.getBody(),
layout:'table',
layoutConfig: {columns:2},
defaults: {
frame:true,
width:200,
height: 200,
style: 'margin: 0 10px 10px 0'
},
items:[{
title:'Shopping Cart',
width: 400,
height: 290,
colspan: 2
},{
title:'Invoice Address',
width: 190,
height: 100
},{
title:'Delivery Address',
width: 200,
height: 100
}
]
})
var table_wrapper = new Ext.Panel({
id:'table_wrapper',
baseCls:'x-plain',
renderTo: Ext.getBody(),
layout:'table',
layoutConfig: {columns:4},
defaults: {
frame:true,
width:200, …Run Code Online (Sandbox Code Playgroud)