如何减小日期列的宽度(“MON”、“TUES”等)以匹配“MON”或“TUES”等所需的空间?换句话说,我想设置宽度日列的长度等于列标题的长度。
<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"];
}