/ Published in: PHP
Here you see a example to make your table background color fdifferent at last
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Abwechselnde Zeilenfarben(MYSQL)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .tableLine { font-family: Verdana,Arial,sans-serif; font-style: normal; font-size: 14px; BORDER-TOP: #A6A6A6 1px solid; BORDER-LEFT: #A6A6A6 1px solid; BORDER-BOTTOM: #A6A6A6 1px solid; BORDER-RIGHT: #A6A6A6 1px solid; } .row_0 { background-color: #FFFFFF; } .row_1 { background-color: #E1E8F1; } --> </style> </head> <body> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableLine" height="100%"> <?php if($res[''id''] % 2){ echo "<tr><td class=''row_0''>Eintrag nr. $res[id]<br />$res[text]</td></tr>"; } else { echo "<tr><td class=''row_1''>Eintrag nr. $res[id]<br />$res[text]</td></tr>"; } } echo "</table>"; ?>
URL: http://darksider3.pf-control.de/all/scripts.php?id=Abwechselnde%20Tabellenfarben%28MYSQL-SELECT