I am creating a program in which I am fetching data from database and showing it in a table. I don't know how much record will be fetch from the database, but I have to print 3 records in a single line, and next 3 in the another line. I have created the following program in the its printing all the records in the same line. I want it to limit this to 3 and after 3 records change line and print the next 3 record in the other line.
<body>
<table border="2px">
<tr>
<?php
for($i=0; $i<=5; $i++)
{
echo "<td> $i </td>";
$i=$i++;
}
?>
</tr>
</table>
</body>