如何在bootstrap中获取一个表,在下面有两列和一行

时间:2017-03-22 18:37:15

标签: css angularjs twitter-bootstrap html-table

我使用ng-repeat循环显示一些数据以显示在表格上。我希望格式为2列的2列和1行...

现在我有:

<table class="table table-borderless table-striped">
     <tbody>
         <tr ng-repeat="file in files">
             <td>{{file}}<br>
             </td>
             <td>{{file.name}}</td>
             <td>{{file.error.message}}</td>
         </tr>
      </tbody>
</table>

例如:

enter image description here

1 个答案:

答案 0 :(得分:2)

Use ng-repeat-start and ng-repeat-end...

  <tr ng-repeat-start="f in files">
    <td>{{file}}</td> 
    <td>{{file.name}}</td>
  </tr>
  <tr ng-repeat-end="">
    <td colspan="2">
      {{file.error.message}}
    </td>
  </tr>

Demo (using sample user data)