Home › Forums › Add-ons › Repeater Field › Display tables 1/2 or 1/3 screen using repeater and get_row_index › Reply To: Display tables 1/2 or 1/3 screen using repeater and get_row_index
Thanks a lot, I’ve already did it this way, and it works
<div class="row">
<?php if(have_rows('table_forms')): ?>
<?php $numrows = count( get_field( 'table_forms' ) ); ?>
<?php while ( have_rows('table_forms') ) : the_row(); ?>
<?php if($numrows <3) {$counttables = 6;} else {$counttables = 4;} ?>
<div class="col-md-<?php echo $counttables; ?>">
<div class="main-table">
<h3><?php the_sub_field('table_forms_name'); ?></h3>
<table class="table main-table-slyle">
<tbody>
<tr>
<td class="main-table-td"><h3>Длительность</h3></td>
<td><?php the_sub_field('table_forms_dlit'); ?></td>
</tr>
<tr>
<td class="main-table-td"><h3>Количество часов</h3></td>
<td><?php the_sub_field('table_forms_kol'); ?></td>
</tr>
<tr>
<td class="main-table-td"><h3>Уровень</h3></td>
<td>
<?php the_sub_field('table_forms_urov'); ?>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<?php endwhile;?>
<?php
else :
// no rows found
endif;
?>
</div>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.