note 88117 deleted from control-structures.for by googleguy
| From: | googleguy@php.net | Date: | Sat, 12 Jan 2013 09:42:26 +0000 |
| Subject: | note 88117 deleted from control-structures.for by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192959@lists.php.net to get a copy of this message | ||
Note Submitter: Steven
----
Alternating form rows:
<?php
$rows = 4;
echo '<table><tr>';
for($i = 0; $i < 10; $i++){
echo '<td>' . $i . '</td>';
if(($i + 1) % $rows == 0){
echo '</tr><tr>';
}
}
echo '</tr></table>';
?>
Changing $rows will change how many columns are in a row.