Mercurial > hg > fapweb
changeset 1020:2a259e243350
Don't use a HTML table for the votekeys.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 05 Nov 2015 19:22:11 +0200 |
parents | 22b6442d5cb3 |
children | 74b98743697b f2b392ee89e8 |
files | examples/css/hardcopy.css print.php |
diffstat | 2 files changed, 15 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/examples/css/hardcopy.css Thu Nov 05 19:11:40 2015 +0200 +++ b/examples/css/hardcopy.css Thu Nov 05 19:22:11 2015 +0200 @@ -2,22 +2,23 @@ font-family: monospace; font-size: 12pt; color: black; - margin: 0px; - padding: 0px; + margin: 0; + padding: 0; } -table.votekeys { - margin: 0px; - padding: 0px; +div.votekeys { + margin: 0; + padding: 0; } -table.votekeys td { +div.votekey { + display: inline-block; text-align: center; - border-right: 1pt dashed black; - border-bottom: 1pt dashed black; - padding: 10pt; + border: 1pt dashed black; + padding: 0.75em; + margin: 0; } -table.votekeys span.keyid { +div.votekey span.keyid { font-weight: bold; }
--- a/print.php Thu Nov 05 19:11:40 2015 +0200 +++ b/print.php Thu Nov 05 19:22:11 2015 +0200 @@ -88,29 +88,17 @@ { cmPrintPageHeader("Votekeys"); $keyLen = stGetSetting("userKeyLength"); - echo "<table class=\"votekeys\">\n"; - $index = 0; + echo "<div class=\"votekeys\">\n"; foreach ($res as $item) { - if ($index == 0) - echo "<tr>\n"; - // This funny code is to ensure that the cells are of uniform width - printf("<td><span class=\"keyid\">%03d</span> : ". - "<span class=\"keycode\">%s</span></td>\n", + printf("<div class=\"votekey\"><span class=\"keyid\">%03d</span> : ". + "<span class=\"keycode\">%s</span></div>\n", $item["id"], str_repeat(" ", $keyLen - strlen($item["key"])).$item["key"]); - - if ($index++ >= 5) - { - echo "</tr>\n"; - $index = 0; - } } - if ($index > 0) - echo "</tr>\n"; - echo "</table>\n"; + echo "</div>\n"; cmPrintPageFooter(); } break;