<table class="myTable">
<tr>
<th>Item No. </th>
<th>Elem1 </th>
<th>Elem2 </th>
<th>Elem3 </th>
<th>Elem4 </th>
</tr>
<?php
//seting group and elements
$this->group = next($this->groups);
$this->elements = $this->group->elements;
//echo "<pre>";print_r( $this->groups);exit; /* check group */
$group = $this->group;
$this->i = 0;
// iretate through group elements to get data and create rows and cells for each repeat item
foreach ($group->subgroups as $subgroup) :
$this->elements = $subgroup;
$c = $this->i; /* counter for #items */
/* Elements */
$elem1 = $this->elements['elem1']->element_raw;
$elem2 = $this->elements['elem2']->element;
$elem3 = $this->elements['elem3']->element_ro;
$elem4 = $this->elements['elem4']->element_ro;
?>
<tr>
<td style="text-align: center;"><?php echo $c + 1, '.'; ?></td>
<td style="text-align: left;"><?php echo $elem1; ?> </td>
<td style="text-align: center;"><?php echo $elem2; ?> </td>
<td style="text-align: center;"><?php echo $elem3; ?> </td>
<td style="text-align: center;"><?php echo $elem4; ?> </td>
</tr>
<?php
$this->i++;
endforeach;
?></table>