How to create table with for loop in PHP

1 Answer

0 votes
echo '<table border="1" cellpadding="3" cellspacing="3">';
for ($row = 1; $row <= 3; $row++)
{
    echo "<tr>";
    for ($col = 1; $col <= 5; $col++)
    {
        echo "<td>data</td>";
    }
    echo "</tr>";
}
echo "</table>";



answered Aug 10, 2014 by avibootz

Related questions

1 answer 110 views
1 answer 246 views
1 answer 122 views
1 answer 98 views
1 answer 218 views
1 answer 160 views
...