Hi,
i am trying to make a table using PHP, and i have a problem numbering each cell with a different number. So if the table is 3x3, like this
1 2 3
4 5 6
7 8 9
Here is what i got (i know what is worng, i am displaying td numbers, but i dont know how to do it like i want...) :
<?php
function drawTable(){
$rows = 4; // amout of tr
$cols = 4;// amjount of td
echo "<table border='1'>";
for($tr=1;$tr<=$rows;$tr++){
echo "<tr>";
for($td=1;$td<=$cols;$td++){
echo "<td align='center'>".$td."</td>";
}
echo "</tr>";
}
echo "</table>";
}
drawTable();
?>