title: Set different colors each row index in html table using Angular 4
body: <p>I would like to set different colors for selected rows programatically each time when a button outside the table is clicked. I am using the latest version of angular.</p>
  
  <p>I know how to set row color with css but do not know how to influence the css class programatically in typescript.</p>
  
  <pre><code>.ui-table .ui-table-tbody &gt; tr:nth-child(1) {
      background-color: #2DA449; 
  }
  </code></pre>
  
  <p>Is there some way to edit the css class to set the child index and b-color in typescript?</p>