From 89c20f70df16a34da0117a9b81533365aca3869e Mon Sep 17 00:00:00 2001 From: Jean-Marc Pigeon Date: Sun, 7 Sep 2025 16:40:50 -0400 Subject: [PATCH] Adding table with background color --- www/directives.js | 18 ++++++++++++++++++ www/lvlusr.php | 22 +++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 www/directives.js 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 ; + } + +
- +
-- 2.47.3
Email lastemail