title: How to format table dynamically within ng-repeat in AngularJS
body: <p>I have a list of items of different types and I would like to display them in a table. 
  The items of one type will have two columns and items of another type just one. Any suggestions how to change conditionally the colspan on the &lt;> tag on fly? </p>
  
  <pre><code> &lt;div ng-init="items = [
      {name:'item1', old:1, new:2}, 
      {name:'item2', old:2, new:2},
      {name:'item3', msg: 'message'},
      {name:'item4', old:0, new:2}
    ]"&gt;
    &lt;table border=1&gt;    
      &lt;tr  ng-repeat="item in items" &gt;                   
       &lt;th&gt;{{item.name}}&lt;/th&gt;
       &lt;td&gt;{{item.old}}&lt;/td&gt;  
       &lt;td colspan='2'&gt;{{item.msg}}&lt;/td&gt;     
       &lt;td&gt;{{item.new}}&lt;/td&gt;      
      &lt;/tr&gt;              
   &lt;/table&gt;
  </code></pre>
  
  <p>Here is the example to play in jsfiddle: <a href="http://jsfiddle.net/38LXt/1/" rel="nofollow">http://jsfiddle.net/38LXt/1/</a></p>
  
  <p>Thanks!</p>