-2

这是我的代码示例..

<table>
 <tr>

  while($report && !$report ->EOF) {
  <td>$name</td>
  $report ->MoveNext();
  }

 </tr>
</table>

我有一个循环列.. 我的问题是,如何强制列或限制列数,以便一行只能容纳 5 列.. 如果超过 5 列,该列将转到下一页。提前致谢

4

1 回答 1

0
<table>
    <tr>
        <?php
        $count = 5;
        while($report && !$report ->EOF && $count > 0) {
            echo "<td>$name</td>";
            $report ->MoveNext();
            $count--;
        }
        ?>
    </tr>
</table>

只是在 while 循环中添加了一个简单的计数器。通过增加计数,您可以显示更多列

于 2013-06-20T09:14:29.773 回答