changeset 283:85d74b8b7ae8

Use CSS instead of a table for votekey admin.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 24 Nov 2013 23:09:33 +0200
parents 50e52dc43916
children 0b6e16ea77c4
files admajax.php admin.css
diffstat 2 files changed, 7 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/admajax.php	Sun Nov 24 23:03:14 2013 +0200
+++ b/admajax.php	Sun Nov 24 23:09:33 2013 +0200
@@ -299,14 +299,13 @@
 
             $keyLen = stGetSetting("userKeyLength");
             $index = 0;
-            echo "<table class=\"votekeys\">\n";
             foreach (stExecSQL($sql) as $item)
             {
               if ($index == 0)
                 echo "<tr>\n";
               
               // This funny code is to ensure that the cells are of uniform width
-              printf("<td id=\"vkey".$item["id"].
+              printf("<div class=\"votekey\" id=\"vkey".$item["id"].
                 "\"><span class=\"keyid\">%03d</span>&nbsp;:&nbsp;".
                 "<span class=\"keycode\">%s</span>",
                 $item["id"],
@@ -318,18 +317,8 @@
                   $item["active"], "", "class=\"keyactive\" onClick=\"voteKeyActivated(".$item["id"].")\"", "xx")."\n";
               }
 
-              echo "</td>";
-              
-              if ($index++ >= 5)
-              {
-                echo "</tr>\n";
-                $index = 0;
-              }
+              echo "</div>";
             }
-            if ($index > 0)
-              echo "</tr>\n";
-
-            echo "</table>\n";
             break;
 
           case VOTE_ASSIGN:
--- a/admin.css	Sun Nov 24 23:03:14 2013 +0200
+++ b/admin.css	Sun Nov 24 23:09:33 2013 +0200
@@ -79,12 +79,10 @@
 }
 
 
-table.votekeys {
+div.votekey {
+	display: inline-block;
+
 	margin: 0px;
-	padding: 0px;
-}
-
-table.votekeys td {
 	text-align: center;
 	padding: 0.5em;
 	background: black;
@@ -93,10 +91,10 @@
 	border-bottom: 1pt dashed green;
 }
 
-table.votekeys span.keyid {
+div.votekey span.keyid {
 	font-weight: bold;
 }
 
-.keyactive {
+div.votekeys .keyactive {
 	margin-left: 1em;
 }