信息表

来源:互联网 发布:mac加速的视频播放器 编辑:程序博客网 时间:2024/06/06 11:17
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style type="text/css">
            table{
                width: 200px;
                height: 200px;
                border: 1px solid black;
                border-collapse: collapse;
                text-align: center;
            }
            th{
                border: 1px solid black;
            }
            td{
                border: 1px solid black;
            }
        </style>
        <script type="text/javascript" src="js/angular.js" ></script>
        <script type="text/javascript">
            var app=angular.module("myapp",[]);
            app.controller("mycon",function($scope){
                $scope.arr=[
                {"name":"小红",
                "sex":"女",
                "age":"18"},
                {"name":"小程",
                "sex":"男",
                "age":"19"},
                {"name":"小黄",
                "sex":"女",
                "age":"20"}];
            });
        </script>
    </head>
    <body>
        <table ng-app="myapp" ng-controller="mycon">
            <tr style="background: yellow;">
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>
            </tr>
            <tr ng-repeat="a in arr">
                <td>{{a.name}}</td>
                <td>{{a.sex}}</td>
                <td>{{a.age}}</td>
            </tr>
        </table>
    </body>
</html>

原创粉丝点击