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 188 views
1 answer 348 views
1 answer 221 views
1 answer 185 views
1 answer 319 views
1 answer 242 views
...