2013-06-30 120 views
0

如何縮小日期列的寬度(「MON」,「TUES」等)以匹配「MON」或「TUES等」所需的空間?換句話說,倒要設置日列等於列標題的長度的寬度。修改表列

http://jsfiddle.net/BnLEh/

<div ng-app="MyModule"> 
<div ng-controller="Controller"> 
    <table border='1' width='200'> 
     <tbody> 
      <tr> 
      <td ng-repeat='day in days' width='20%'>{{day}}</td> 
      </tr> 
      <tr ng-repeat='x in [1,2,3,4]'> 
      <td> 
       <input placeholder='Enter Charge #' size='10'> 
      </td> 
      <td ng-repeat='t in [1,2,3,4,5,6,7]' width='10%'> 
       <input type="number" size='3'> 
      </td> 
      </tr> 
     </tbody> 
    </table> 
    </div> 
</div> 

var optModule = angular.module('MyModule', []); 

    function Controller($scope) { 
     $scope.days = ["", "MON", "TUE", "WED", 
      "THU", "FRI", "SAT", "SUN"];   
    } 

回答