せかいのー
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>なつかしの</title> <style> .three{ color:#F00; font-weight:bold; font-size:1.2em; } .five{ color:#FF0; font-weight:bold; font-size:1.2em; } .fifteen{ color:#00F; font-weight:bold; font-size:1.6em; } .other{ } table{ border-collapse:collapse; } th{ border:1px solid #666; width:100px; } td{ border:1px solid #666; width:100px; } </style> <!--[if lte IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!--[if lte IE 9]> <script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script> <![endif]--> </head> <body> <table><tr> <?php $max=100; for($i=0;$i<$max;$i++){ $viewer=$i+1; $mod3 = $viewer%3; $mod5 = $viewer%5; $mod15 = $viewer%15; if($mod15==0){ print("<td class=\"fifteen\">{$viewer}</td></tr>".closeTag($viewer)); }else if($mod5==0){ print("<td class=\"five\">{$viewer}</td></tr>".closeTag($viewer)); }else if($mod3==0){ print("<td class=\"three\">{$viewer}</td>"); }else{ print("<td class=\"other\">{$viewer}</td>"); } } function closeTag($index){ $rtn; if($index!=100){ $rtn="</tr>"; } return $rtn; } ?> </table> </body> </html>
まあ、実行してみてください。