Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Szorzótábla</title>
- <style type="text/css">
- td { text-align: right; }
- td.negyzet { background-color: #eeeeee; font-weight: bold; }
- </style>
- </head>
- <body>
- <h2>Szorzótábla</h2>
- <table border="1">
- <?php
- for ($i = 1; $i <= 10; $i++) {
- echo "<tr>";
- for ($j = 1; $j <= 10; $j++) {
- $ki = ($i == $j) ? '<td class="negyzet">' : '<td>';
- echo $ki;
- echo $i.' * '.$j.' = ',$i*$j;
- echo '</td>';
- }
- echo "</tr>";
- }
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement