diff options
author | Edmondo Tommasina | 2010-05-19 14:59:45 +0200 |
---|---|---|
committer | Pim van den Berg | 2010-05-29 09:43:12 +0200 |
commit | 055871bb1ac4378212acd797f96dc1a62c0631ef (patch) | |
tree | 6e1b77cd146423ebcc998e4706cb27c04ed88867 | |
parent | a source (type instance or data source) may contain dots (diff) | |
download | apt-panopticon_cgp-055871bb1ac4378212acd797f96dc1a62c0631ef.zip apt-panopticon_cgp-055871bb1ac4378212acd797f96dc1a62c0631ef.tar.gz apt-panopticon_cgp-055871bb1ac4378212acd797f96dc1a62c0631ef.tar.bz2 apt-panopticon_cgp-055871bb1ac4378212acd797f96dc1a62c0631ef.tar.xz |
Define alternating odd/even css classes for rows in main summary
To select different background colors for the rows in the main
summary page, just uncomment the tr.odd/tr.even background
definition in layout/style.css and set the color.
-rw-r--r-- | inc/html.inc.php | 8 | ||||
-rw-r--r-- | layout/style.css | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/inc/html.inc.php b/inc/html.inc.php index a05aab6..ada8d99 100644 --- a/inc/html.inc.php +++ b/inc/html.inc.php | |||
@@ -66,8 +66,14 @@ function host_summary($hosts) { | |||
66 | 66 | ||
67 | echo "<table class=\"summary\">\n"; | 67 | echo "<table class=\"summary\">\n"; |
68 | 68 | ||
69 | $row_style = array(0 => "even", 1 => "odd"); | ||
70 | $host_counter = 0; | ||
71 | |||
69 | foreach($hosts as $host) { | 72 | foreach($hosts as $host) { |
70 | printf('<tr><th><a href="%s/host.php?h=%s">%s</a></th>', | 73 | $host_counter++; |
74 | |||
75 | printf('<tr class="%s">', $row_style[$host_counter % 2]); | ||
76 | printf('<th><a href="%s/host.php?h=%s">%s</a></th>', | ||
71 | $CONFIG['weburl'],$host, $host); | 77 | $CONFIG['weburl'],$host, $host); |
72 | 78 | ||
73 | if ($CONFIG['showload']) { | 79 | if ($CONFIG['showload']) { |
diff --git a/layout/style.css b/layout/style.css index 83664a4..e478203 100644 --- a/layout/style.css +++ b/layout/style.css | |||
@@ -48,6 +48,14 @@ table.summary th { | |||
48 | text-align: left; | 48 | text-align: left; |
49 | } | 49 | } |
50 | 50 | ||
51 | table.summary tr.even { | ||
52 | /* background: #eeeeee; */ | ||
53 | } | ||
54 | |||
55 | table.summary tr.odd { | ||
56 | /* background: #cccccc; */ | ||
57 | } | ||
58 | |||
51 | table.summary td { | 59 | table.summary td { |
52 | width: 50px; | 60 | width: 50px; |
53 | text-align: right; | 61 | text-align: right; |