How to add 'odd' or 'even' class in each row of a Views Table output?
This can be related to Drupal, since you want to add classes to table rows, here is how you do it: 

Copy the core/themes/classy/themplates/views/views-view-table.html.twig to your theme's template folder, and change the following lines (line 95):

  &lt;tbody&gt;
    {% for row in rows %}
      {% set parity = cycle(['odd', 'even'], loop.index0) %}
      &lt;tr {{ row.attributes.addClass(parity) }}&gt;