Support

Account

Home Forums Add-ons Repeater Field Splitting fields into table rows Reply To: Splitting fields into table rows

  • Hi @ordog ,

    Here is a sample using two while loops to show the data. Let me know if it helps.

    <table>
    
    <?php while( have_rows('my_repeater') ): the_row(); 
    
    // vars
    $field1 = get_sub_field('field1');
    $field2 = get_sub_field('field2');
    ?>
    
     <tr>
     // All $field1 and $field2 fields in this row each wrapped in <td> tags
      <td><?php echo $field1; ?></td>
      <td rowspan="2"><?php echo $field2; ?></td>
     </tr>
     
    <tr>
    
    <?php endwhile; ?>
    
    <?php while( have_rows('my_repeater') ): the_row(); 
    $field3 = get_sub_field('field3');
    ?>
    
     
    <tr>
     // All $field 3 in this row wrapped in <td> tags
     <td><?php echo $field3; ?></td>
    </tr>
    
    <?php endwhile; ?>
    
    </table>

    Hopefully this helps. 🙂