【第三课】WEBIX 入门自学-Hello World

在看官网教程时,入门的例子就是dataTable这个空间。So,遵循官网,一起来看一下入门的DataTable组件;

WEB使用时固然是先引入相应的库文件;

代码如下

<html>
<head>
    <title>Quick start with DataTable</title>   
    <script src="../codebase/webix.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" href="../codebase/webix.css" type="text/css" charset="utf-8">
</head>
<body>
    <script>
        //here you will place your JavaScript code
    </script>
</body>
</html>

 

来一个小栗子吧

包含表头的3X3的表格

<!DOCTYPE html>
<html>
    <head>
        <title>Quick start with DataTable</title>
        <link rel="stylesheet" href="../../../codebase/webix.css" type="text/css" charset="utf-8">
        <script src="../../../codebase/webix.js" type="text/javascript" charset="utf-8"></script>
    </head>
    <body>
        <div class='header_comment'>Minimal code to init DataTable</div>
        <div id="testA"></div>

    <script>
    var dtable = webix.ui({
            container:"testA",//定义内部表格ID(html)
            view:"datatable",//声明为datatable组件
            columns:[
                { id:"title",   header:"Film title",    width:200},//表头
                { id:"year",    header:"Release year" , width:80},
                { id:"votes",   header:"Votes",         width:100}
            ],
            autowidth:true,//自动宽度
            autoheight:true,//自动高度
            data:[//表格数据
                { id:1, title:"The Shawshank Redemption", year:1994, votes:678790},
                { id:2, title:"The Godfather",            year:1972, votes:511495}
            ]
    });
    </script>
</body>
</html>

上效果图~

代码简洁到爆  只需要制定js代码  框架库自动生成相应组件~~~

好了 这一课就先到这了

 

转载于:https://www.cnblogs.com/jso0/p/4691825.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值