小编use*_*167的帖子

AngularJS ng-repeat of TH

我是一个新的程序员AngularJS,我在尝试为表格实现特定模板时遇到问题.我想实现下表,但找不到怎么做:

<!DOCTYPE HTML>
    <html >
    <head>
       <title></title>
    </head>
    <body >
        <table border="1" width="50%" cellspacing="0" cellpadding="3">
        <tbody>
            <tr>
               <th colspan="33">XXXXXXXXXXXXXXXXXXXXXXX</th>
            </tr>
            <tr>
               <th rowspan="2">&nbsp;</th>
               <th colspan="2">P1</th>
               <th colspan="2">P2</th>
               <th colspan="2">P3</th>
            </tr>
            <tr >
               <th >INFO1</th>
               <th >INFO2</th>
               <th >INFO1</th>
               <th >INFO2</th>
               <th >INFO1</th>
               <th >INFO2</th>
            </tr>           
       </tbody>
       </table
    </body>
    </html>
Run Code Online (Sandbox Code Playgroud)

我在AngularJS中有以下代码但是我不能重复,因为没有包装的html元素:

    <!DOCTYPE HTML>
    <html ng-app="myApp">
    <head>
    <title></title>
        <script src="js/angular.js"></script>
        <script>
        var app = angular.module('myApp', []);
        app.controller("myCTL",['$scope',function($scope){
            $scope.datas=[{id:'1', name:'P1',pct:'10'},{id:'2', name:'P2',pct:'70'},{id:'3', name:'P3',pct:'66'}]
        }])
        </script>

    </head>
    <body ng-controller="myCTL">
        <table border="1" width="50%" cellspacing="0" cellpadding="3">
           <tbody> …
Run Code Online (Sandbox Code Playgroud)

html5 angularjs angularjs-ng-repeat

4
推荐指数
1
解决办法
2791
查看次数

标签 统计

angularjs ×1

angularjs-ng-repeat ×1

html5 ×1