help with a program

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gammaman
Forum Commoner
Posts: 45
Joined: Tue Feb 12, 2008 9:22 am

help with a program

Post by gammaman »

I wrote the following code to display the multiplication tables. Instead of having one large table like it is now, I want to create 10 seperate tables with spaces between them. Anyone have any suggestions?


<html>
<!-- Matthew Fierro
Tables
-->


<table border = "1">;
<?php
for ($a=1; $a<=10; $a+=5){

for ($r=0; $r<=10; $r++){
echo "<tr>";
for ($c=$a; $c<=$a+4;$c++){
$x=$c*$r;
echo "<td width= 60> $c x $r = </td> <td width=60> $x </td>";
}

echo "</tr>";

}
echo "<tr><td height=30></td></tr>";
}

?>
</table>;
</html>
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: help with a program

Post by superdezign »

10 separate tables how? What sort of layout?
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Re: help with a program

Post by liljester »

there was a similar question earlier this week.

viewtopic.php?f=1&t=78716&p=442879&hili ... le#p442879

are you guys getting help on class assignments by any chance? :)
Post Reply