[vlma-devel] commit: Conditionnal row coloring. (Adrien Grand )

git version control git at videolan.org
Tue Apr 22 00:29:22 CEST 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Mon Apr 21 23:44:01 2008 +0200| [97ffe502767f5c7a7109b192b27de33de002b0d9]

Conditionnal row coloring.

It helps to distinguish rows easier in large tables.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=97ffe502767f5c7a7109b192b27de33de002b0d9
---

 .../webapp/WEB-INF/jsp/medias/mediaslist_right.jsp |   24 ++++++++++++++++---
 web/src/main/webapp/css/style.css                  |   14 ++++++++++-
 2 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/web/src/main/webapp/WEB-INF/jsp/medias/mediaslist_right.jsp b/web/src/main/webapp/WEB-INF/jsp/medias/mediaslist_right.jsp
index 6edfc8a..c8985eb 100644
--- a/web/src/main/webapp/WEB-INF/jsp/medias/mediaslist_right.jsp
+++ b/web/src/main/webapp/WEB-INF/jsp/medias/mediaslist_right.jsp
@@ -18,8 +18,16 @@
     
     <c:set var="frequency" value="0" />    
 
-    <c:forEach items="${channelsTNT}" var="channelTNT">
-    <tr>
+    <c:forEach items="${channelsTNT}" var="channelTNT" varStatus="status">
+    <c:choose>
+        <c:when test='${(status.index)%2 eq 0}'>
+            <c:set var="rowColor" value="even" scope="page"/>
+        </c:when>
+        <c:otherwise>
+            <c:set var="rowColor" value="odd" scope="page"/>
+        </c:otherwise>
+    </c:choose>
+    <tr class="${rowColor}">
         <td><small>
         <c:if test="${frequency != channelTNT.frequency}">
             <c:out value="${channelTNT.frequency}" />
@@ -113,8 +121,16 @@
     
     <c:set var="frequency" value="0" />    
 
-    <c:forEach items="${channelsSat}" var="channelSat">
-    <tr>
+    <c:forEach items="${channelsSat}" var="channelSat" varStatus="status">
+    <c:choose>
+        <c:when test='${(status.index)%2 eq 0}'>
+            <c:set var="rowColor" value="even" scope="page"/>
+        </c:when>
+        <c:otherwise>
+            <c:set var="rowColor" value="odd" scope="page"/>
+        </c:otherwise>
+    </c:choose>
+    <tr class="${rowColor}">
         <td><small>
             <c:if test="${frequency != channelSat.frequency}">
                 <c:out value="${channelSat.coverage}" />
diff --git a/web/src/main/webapp/css/style.css b/web/src/main/webapp/css/style.css
index 6eb993f..6cb33f9 100644
--- a/web/src/main/webapp/css/style.css
+++ b/web/src/main/webapp/css/style.css
@@ -233,17 +233,27 @@ input.searchbutton {
     font-family: Arial, Sans-serif; 
     border: none; 
     background: #FFFFFF; 
-  color: #808080; 
+    color: #808080;
     padding: 1px; 
     font-weight: bold; 
 }
 
 th {
+    padding: 2px;
     text-align : left;
+    color: #fff;
+    background-color: #8df;
+}
+
+tr.even {
+    background-color: #eff;
+}
+
+tr.odd {
+    background-color: #fff;
 }
 
 td {
     text-align : left;
 }
 
-



More information about the vlma-devel mailing list