PHP - Tabelle mehrfarbig ausgeben
#FFDDDD |
#DDFFDD |
#DDDDFF |
#FFDDDD |
#DDFFDD |
#DDDDFF |
#FFDDDD |
<table>
<?php
// Tabelle mehrfarbig ausgeben
function bgColorRotate($n, $bgColors) {
return $bgColors[$n % sizeof($bgColors)];
}
$bgColors = array('#FFDDDD', '#DDFFDD', '#DDDDFF'); // usw.
for ($i = 0; $i < 7; $i++) {
echo '<tr style="background:' . bgColorRotate($i, $bgColors) .
'"><td>' . bgColorRotate($i, $bgColors) . '</td></tr>';
}
?>
</table>
Bausteine Alle Anzeigen
Eine zufällige Auswahl von Codeschnipseln
aus den Bereichen
HTML, CSS,
PHP, JavaScript und
MySQL.
<head> Kopfdaten
CSS - DiscoLights - Box-Shadow Animation
PHP - Die ersten X-Wörter eines Satzes ausgeben
JavaScript - Eine Animation ab einer bestimmten Scroll-Position starten