From: Jean-Marc Pigeon Date: Sun, 7 Sep 2025 20:40:50 +0000 (-0400) Subject: Adding table with background color X-Git-Tag: end-0.15~12 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=89c20f70df16a34da0117a9b81533365aca3869e;p=jmp%2Fmailleur Adding table with background color --- diff --git a/www/directives.js b/www/directives.js new file mode 100644 index 0000000..ea33a6d --- /dev/null +++ b/www/directives.js @@ -0,0 +1,18 @@ +// vim: smarttab tabstop=8 shiftwidth=2 expandtab + +.table-userlist tr:nth-child(odd) + { + background-color: #66ff99; + color: yellow ; + } + +.table-userlist tr:nth-child(even) + { + background-color: #e6f7ff ; + color: black ; + } + +.myTable { background-color:#eee;border-collapse:collapse; } +.myTable th { background-color:#000;color:white;width:50%; } +.myTable td, .myTable th { padding:5px;border:1px solid #000; } + diff --git a/www/lvlusr.php b/www/lvlusr.php index ef839a4..80917c7 100644 --- a/www/lvlusr.php +++ b/www/lvlusr.php @@ -17,9 +17,14 @@ function body($logname) global $isadmin; $line=""; +$count=0; $dbsql=sql_connect(); $emails=sql_getemaillist($dbsql,NULL,NULL); foreach($emails as $email) { + $bgcolor="white"; + if ($count & 1 ) { + $bgcolor="green"; + } $name=$email['email']; $last=$email['lastemail']; $max=$email['mxspace']; @@ -30,6 +35,7 @@ foreach($emails as $email) { $line=$line."$max"; $line=$line."$lock"; $line=$line.""; + $count++; } sql_close($dbsql); @@ -42,8 +48,22 @@ $footer=footer("lvlusr"); $STR = << +.table-userlist tr:nth-child(odd) + { + background-color: #66ff99; /*light green */ + color: black ; + } + +.table-userlist tr:nth-child(even) + { + background-color: white; + color: black ; + } + +
- +
Email lastemail