【问题标题】:How to get a table in bootstrap to have two columns and a row underneath如何在引导程序中获得一个表格以在下面有两列和一行
【发布时间】:2017-08-15 01:32:55
【问题描述】:

我正在使用 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>

例如:

【问题讨论】:

  • 发布files数组
  • 它只是一个包含字符串的数组....寻找更多样式帮助

标签: css angularjs twitter-bootstrap html-table


【解决方案1】:

使用ng-repeat-startng-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)

【讨论】:

  • 哇,不知道 ng-repeat 有开始也有结束...谢谢!
猜你喜欢
  • 2019-10-24
  • 2021-11-28
  • 1970-01-01
  • 1970-01-01
  • 2018-12-05
  • 2018-11-30
  • 1970-01-01
  • 2015-04-20
  • 2019-08-11
相关资源
最近更新 更多