1
<table border=1>
 <thead>
   <tr>
      <th>Group</th>
      <th>Status</th>
     <th>Name</th>
     <th>Gender</th>          
   </tr>
 </thead>    
 <tbody ng-repeat="group in groups">
   <tr>
     <td rowspan="3">{{group.name}}</td>  
     <td rowspan="3">{{group.status}}</td>        
   </tr>
   <tr ng-repeat="member in group.members">
     <td>{{ member.name }}</td>
     <td>{{ member.gender }}</td>
   </tr>
 </tbody>
</table>

The above code gives the output as below:

enter image description here

I need to make the Status column the 4th column instead of the current 2nd i.e appear after the Gender column. I tried using ng-repeat-start by adding one more tr having the status td but it comes as another row

JS-Bin for the same

1
  • 1
    If you absolutely need to keep table tag, likely easiest to create a directive to generate the html yourself. Otherwise might consider using a <div> structure which would be easier to construct Commented Apr 26, 2015 at 15:22

1 Answer 1

1

Using ng-if checking the $index using modulo (%) for the columns with a rowspan might do the trick: jsbin.com/jaxuvavaba

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.