esercizi in php

This commit is contained in:
2014-10-25 15:24:01 +02:00
parent 8e3c635fd9
commit c318b09580
10 changed files with 448 additions and 0 deletions

76
php_1_5.php Normal file
View File

@@ -0,0 +1,76 @@
<?php
include ('header.html');
///////////////////////////
echo<<<_css
<style>
table {border: 1px solid black;}
td {
border: 1px solid black;
text-align:center;
}
table tr:nth-child(3n+2) {
background-color:green;
}
table tr:nth-child(3n+3) {
background-color:pink;
}
table tr:nth-child(3n+4) {
background-color:red;
}
tr#first {
background-color:yellow;
}
</style>
_css;
echo "\n";
///////////////////////////
echo "<table>";
echo "<tr id=\"first\"> <td>Numero</td> <td>Riga</td> </tr>";
for ($i=1;$i<=12;$i++){
echo "<tr>";
for ($y=1;$y<=2;$y++){
echo "<td>";
if ($y == 1){
echo $i;
} else {
echo "riga " . $i;
}
echo"</td>";
}
echo "</tr>\n";
}
echo "</table>";
include ('footer.html');
?>