Home  >  Article  >  Backend Development  >  PHP 页面循环展示tr td 里面放值

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

WBOY
WBOYOriginal
2016-06-13 12:38:301206browse

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

<br />
 <table width="100%" border="0" cellspacing="0" cellpadding="0"><br />
        <tr><br />
          <?php<br />
          $i = 0;<br />
          foreach($info['list'] as $ent){<br />
          $ent = $ent['info'];<br />
          $checked = $ent['flag']==1?"checked='checked'":"";<br />
          echo '<td>';<br />
	  echo '<input id="view_'.$i.'" class="Sedd" type="checkbox" value="'.$ent["code"].'" name="view[]" '.$checked.'>';<br />
	  echo '  ';<br />
          echo '<label for="view_'.$i.'">'.$ent["name"].'</label>';<br />
          echo '    ';<br />
	  echo '</td>';<br />
          $i ++;<br />
          }<br />
          ?><br />
        </tr><br />
</table><br />
<br />
<br> <br>
---------------------------------
现在显示出来的效果是:<br> <br> ------------------------------------
我想要排出来的效果如下:<br> <br>
代码已经贴出来了,求大虾帮我改一下排版显示效果

php checkbox html
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn