Structured content with unknown number of "fields"

Don’t know if I get you right, but how about a nested foreach loop, something like this:

<table>
  <?php foreach($page->training()->toStructure() as $item): ?>
  <?php $count = count($item) ?>
    <tr>
      <?php foreach($item as $key => $detail): ?>
        <td><?= $detail ?></td>
      <?php endforeach ?>
    </tr>
  <?php endforeach ?>
 </table>