jeremy
jeremy

Reputation: 433

How to get a table in bootstrap to have two columns and a row underneath

I'm using a ng-repeat to loop through some data to show on a table. I want the format to be 2 columns and 1 row under the 2 columns...

Right now I have:

<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>

For example:

enter image description here

Upvotes: 0

Views: 47

Answers (1)

Carol Skelly
Carol Skelly

Reputation: 362360

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)

Upvotes: 2

Related Questions