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

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

WBOY
Release: 2016-06-13 11:34:02
Original
1451 people have browsed it

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 />
Copy after login
<br><br>
---------------------------------
现在显示出来的效果是:<br><br>------------------------------------
我想要排出来的效果如下:<br><br>
代码已经贴出来了,求大虾帮我改一下排版显示效果

php checkbox html
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template