I need to write a script which can display an XHTML table with a numeric value displayed in each table cell. The script should use a nested loop construct and should be able, by changing the value of two variables (for example, $intWidth and $intHeight). to adjust the size of the table. This is what I have:
<?php
$i =1;
while($i<=8) {
if($i%4==1) {
echo "<tr>";
}
echo "<td>".$i."</td>";
$i++;
if($i%4==1) {
echo "</tr>";
}
}
?>
</table>
burt.munn
0
Light Poster
Recommended Answers
Jump to Post<off-topic>
I noticed that you are creating new threads while others are on-going. This is not a crime, but if the other threads are solved, please mark them so:http://www.daniweb.com/web-development/php/threads/475985/tables#post2078800
</off-topic>
The rows and cols are straightworward...
$rows = 10; $cols = 9; function …
All 4 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.