This commit is contained in:
FlyInTheBox 2022-12-21 13:46:11 +01:00
parent d135580aff
commit 6972311109

View file

@ -11,27 +11,48 @@
border: 2px solid black; border: 2px solid black;
padding: 20px; padding: 20px;
} }
table { table {
border-collapse: collapse; border-collapse: collapse;
text-align: center;
}
.cyan:nth-child(even){
background-color: cyan;
} }
</style> </style>
</head> </head>
<body> <body>
<h1>
<?PHP
echo (strftime("%B"));
?>
</h1>
<table> <table>
<tr> <tr>
<?PHP <?PHP
$x = date("t"); $x = date("t");
echo "<caption>".$x."</caption>";
for ($i = 1; $i <= $x; $i++) { for ($i = 1; $i <= $x; $i++) {
$z=$i%7; $z = $i % 7;
if ($z!=0){ if ($z != 0) {
echo "<td>" . $i . "</td>"; echo "<td>" . $i . "</td>";
} } else {
else {
echo "<td>" . $i . "</td>"; echo "<td>" . $i . "</td>";
echo "</tr><tr>"; echo "</tr><tr>";
} }
}
?>
</tr>
</table>
<br>
<hr>
<br>
<table>
<tr>
<?PHP
$array = array("pon","wto","śro","czw","pią","sob","nie");
foreach ($array as $i) {
echo "<td class='cyan'>".$i."</td>";
} }
?> ?>
</tr> </tr>