Hi everyone!
I have to create some kind of dynamic page, logic is next:
i have integer in variable and i need to create certain number of fields based on that int....example
$variable = 6 and I need to have table with 6 fields, 4 in one row and 2 in second....my problem is how to do that, how to get new <tr> when number in bigger than 3....
thanks in advanced
use PHP result to format table
Moderator: General Moderators
to get you started...
Code: Select all
if ($variable > 3) {
echo "</tr>";
}lets say i have something like this:
i need 3 fields pre row....
i need some more help
Code: Select all
<table>
<tr>
<?php
$i = 5;
for($j = 0; $j<$i; $j++)
{
?>
<td><input type="text" name="somename" value="<?php echo $j; ?>"></td>
<?php
}
?>
</tr>
</table>i need some more help
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
read the first to links in Useful Posts.