0
点赞
收藏
分享

微信扫一扫

动态数据的分每行四列显示

醉倾城1 2022-08-08 阅读 81


 

<?php $i="1"; foreach( $form->arealist as $key =>$place ){ ?>    
<?php if($i=="1"){ print "<tr>";} ?>
<td><input name="area[<?php print $key; ?>]" type="checkbox" value="<?php print $key; ?>"
<?php print(($form->coverarealist[$key] == 'checked')||($form->coverarealist[99] =='checked')) ? 'checked' : ''; ?>/></td>
<td width="70"><?php print($place)? $place->getDot_region_nm():"" ?></td>
<?php if($i=="4"){ print "</tr>"; $i="0";} ?>
<?php $i++; } ?>

方法2:$i%4=="0"来实现换行!

 

举报

相关推荐

0 条评论