日期:2014-05-17  浏览次数:20475 次

PHP 页面循环显示tr td 里面放值

 <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <?php
          $i = 0;
          foreach($info['list'] as $ent){
          $ent = $ent['info'];
          $checked = $ent['flag']==1?"checked='checked'":"";
          echo '<td>';
  echo '<input id="view_'.$i.'" class="Sedd" type="checkbox" value="'.$ent["code"].'" name="view[]" '.$checked.'>';
  echo '&nbsp;&nbsp;';
          echo '<label for="view_'.$i.'">'.$ent["name"].'</label>';
          echo '&nbsp;&nbsp;&nbsp;&nbsp;';
  echo '</td>';
          $i ++;
          }
          ?>
        </tr>
</table>




---------------------------------
现在显示出来的效果是:

------------------------------------
我想要排出来的效果如下:


代码已经贴出来了,求大虾帮我改一下排版显示效果
php checkbox html

------解决方案--------------------


<table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
<?php
$i=0;
foreach($info['list'] as $ent){
$ent = $ent['info'];
$checked = $ent['flag']==1?"checked='checked'":"";