Angularjs 具有ng repeat的表格显示不正确

Angularjs 具有ng repeat的表格显示不正确,angularjs,Angularjs,伙计们,我正在使用一个简单的ng repeat指令来显示表中的数据。 但是,当该指令呈现时,第一列将占用所有空间并显示表格 请在此处查看plnkr: 请关注layout.html文件 <table> <thead> <tr ng-repeat="element in header" class="header-cells" style="width:{{element.width}}px"> <th drop-down-sort

伙计们,我正在使用一个简单的ng repeat指令来显示表中的数据。 但是,当该指令呈现时,第一列将占用所有空间并显示表格

请在此处查看plnkr:

请关注layout.html文件

<table>
  <thead>
    <tr ng-repeat="element in header" class="header-cells" style="width:{{element.width}}px">
      <th drop-down-sort-menu>{{element.column}}</th>
    </tr>
  </thead>

  <tbody>
    <tr ng-repeat="element in body">
      <td ng-repeat="h in header" row="{{$parent.$index}}" col="{{$index}}" style="width:{{element.width}}px">{{element[h.column]}}
      </td>
    </tr>
  </tbody>
</table>

{{element.column}
{{element[h.column]}

我相信这是件小事。任何线索

我相信你的问题是,对于标题,你有4个TR,只有一个TH,而不是一个TR,有4个TH。因此,标题上的单元格与正文上的单元格不匹配

在第TH级重复第一次ng


试试看,让我知道。

您遇到了一些问题。我无法发布答案,因为有人标记了你的帖子。@James,最好让你的问题更清楚一点,以免被标记。Craig。。你的解决方案奏效了非常感谢。。很遗憾,我不能认为你的答案是正确的