esercizi in php
This commit is contained in:
76
php_1_5.php
Normal file
76
php_1_5.php
Normal 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');
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user