- Ext.js 教程
- Ext.js - 首页
- Ext.js - 概述
- Ext.js - 环境设置
- Ext.js - 命名约定
- Ext.js - 架构
- Ext.js - 第一程序
- Ext.js - 类系统
- Ext.js - 容器
- Ext.js - 布局
- Ext.js - 组件
- Ext.js - 拖放
- Ext.js - 主题
- Ext.js - 自定义事件和侦听器
- Ext.js - 数据
- Ext.js - 字体
- Ext.js - 样式
- Ext.js - 绘图
- Ext.js - 本地化
- Ext.js - 可访问性
- Ext.js - 调试代码
- Ext.js - 方法
- Ext.js 有用资源
- Ext.js - 问答
- Ext.js - 快速指南
- Ext.js - 有用资源
- Ext.js - 讨论
Ext.js - 表格布局
该布局顾名思义,是像 HTML 表格格式一样,在容器中排列组件。
语法
使用表格布局的一种简单语法如下。
layout: 'table'
实例
以下是一个展示如何使用表格布局的简单实例。
<!DOCTYPE html>
<html>
<head>
<link href = "https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-classic/resources/theme-classic-all.css"
rel = "stylesheet" />
<script type = "text/javascript"
src = "https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/ext-all.js"></script>
<script type = "text/javascript">
Ext.onReady(function() {
Ext.create('Ext.container.Container', {
renderTo : Ext.getBody(),
layout : {
type :'table',
columns : 3,
tableAttrs: {
style: {
width: '100%'
}
}
},
width:600,
height:200,
items : [{
title : 'Panel1',
html : 'This panel has colspan = 2',
colspan :2
},{
title : 'Panel2',
html : 'This panel has rowspan = 2',
rowspan: 2
},{
title : 'Panel3',
html : 'This s panel 3'
},{
title : 'Panel4',
html : 'This is panel 4'
},{
title : 'Panel5',
html : 'This is panel 5'
}]
});
});
</script>
</head>
<body>
</body>
</html>
上述程序将产生以下结果 −
extjs_layouts.htm
广告