style: common setup for floating tables
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 17 Oct 2009 23:02:30 +0000 (23:02 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Sun, 18 Oct 2009 13:16:51 +0000 (13:16 +0000)
base.css
charset.plp
termcol.plp
unicode.plp

index fb998d06ed292e76674ea446e185fe90327262a0..bfce8a2568bc3164dca2ae7364c8069e5be20861 100644 (file)
--- a/base.css
+++ b/base.css
@@ -28,7 +28,7 @@ h1, h2 {
        margin: 0;
 }
 h2, caption {
-       font-size: 125%;
+       font-size: 110%;
        font-weight: bold;
 }
 caption {
@@ -42,11 +42,17 @@ hr {
        margin: 0;
 }
 
-.diinfo h2 {
+.section h2 {
        margin: 0 1ex;
        clear: both;
-       font-size: 110%;
-       text-align: left;
+}
+.section table {
+       float: left;
+       position: relative; /* prevents buggy hovering in table if caption present in gecko */
+       margin: 1ex 1ex 2ex;
+}
+#charset .section table {
+       margin: -0.5ex 0 1ex; /* headers provide sufficient spacing already */
 }
 
 p {
@@ -150,11 +156,6 @@ ul.keys.ctrl li b small { /* meta key indicator */
 
 /* tables */
 
-li table {
-       float: left;
-       position: relative; /* prevents buggy hovering if table-caption present in gecko */
-}
-
 table {
        border-collapse: collapse;
 }
@@ -240,11 +241,6 @@ table.glyphs.dimap {
        overflow: hidden;
 }
 
-.diinfo table.glyphs {
-       margin: 1ex 1ex 2ex;
-       float: left;
-}
-
 /* glyph cell overlay (digraph labels) */
 
 .glyphs.dilabel td {
index e82c5cc45823fcea40ace71247ddf07ba62f66e1..73f93772f26738c1fbb37304d465841ebbe73388 100644 (file)
@@ -18,7 +18,7 @@ $header{content_type} = 'text/html; charset=utf-8';
 <link rel="stylesheet" type="text/css" media="all" href="/base.css">
 </head>
 
-<body>
+<body id="charset">
 <h1>Character encoding</h1>
 
 <:
@@ -109,11 +109,9 @@ sub quote {
        return $_;
 }
 
-print "<ul>\n";
-
 my @nibble = (0..9, 'A'..'F');
 for my $row (@request) {
-       printf '<li><table class="glyphs%s">', !$row->{cell} && ' charmap';
+       printf '<div class="section"><table class="glyphs%s">', !$row->{cell} && ' charmap';
        printf '<caption>%s</caption>', $row->{set};
        print '<col>' x 17;
        for my $section (qw{thead}) {
@@ -158,11 +156,9 @@ for my $row (@request) {
                }
                print "\n";
        }
-       print "</table>\n";
+       print "</table></div>\n";
 }
 
-print "</ul>\n";
-
 :>
 <hr>
 
index 359b33d7db1a51530f5472a9e69c3d45c6459378..9e9ad19858df894915ec08ef981db9b803e13683 100644 (file)
@@ -22,7 +22,7 @@ $header{content_type} = 'text/html; charset=utf-8';
 <body id="colour">
 <h1>Terminal colours</h1>
 
-<ul>
+<div class="section">
 <:
 sub luminance {
        # perceived brightness (using ITU-R recommendation 601 luma co-efficients)
@@ -77,7 +77,6 @@ my %col = (
 );
 
 for my $term (qw/html cga xterm tango/) {
-       print '<li>', "\n";
        print '<table>', "\n";
        print "<caption>$term</caption>\n";
        for my $num (0 .. 15) {
@@ -85,15 +84,17 @@ for my $term (qw/html cga xterm tango/) {
                print '<tr>',
                        colcell($col{"-$term"}[$num] || $num, $rgb, $col{$term}[0]);
        }
-       print "</table></li>\n\n";
+       print "</table>\n\n";
 }
-:></ul>
+:></div>
 
 <hr>
-<h2>88-colour space</h2><ul>
+
+<div class="section">
+<h2>88-colour space</h2>
 <:
 for my $r (0 .. 3) {
-       print '<li><table>';
+       print '<table>';
        for my $g (0 .. 3) {
                print '<tr>';
                for my $b (0 .. 3) {
@@ -105,16 +106,18 @@ for my $r (0 .. 3) {
 }
 print "\n";
 
-print '<li><table><tr>';
+print '<table><tr>';
 print colcell(80, ($_) x 3) for 46, 92, 115, 139, 162, 185, 208, 231;
 print "</table>\n\n";
-:></ul>
+:></div>
 
 <hr>
-<h2>256-colour space</h2><ul>
+
+<div class="section">
+<h2>256-colour space</h2>
 <:
 for my $r (0 .. 5) {
-       print '<li><table>';
+       print '<table>';
        for my $g (0 .. 5) {
                print '<tr>';
                for my $b (0 .. 5) {
@@ -127,12 +130,12 @@ for my $r (0 .. 5) {
 print "\n";
 
 for my $row (0, 12) {
-       print '<li><table><tr>';
+       print '<table><tr>';
        print colcell(232+$_, ($_*10 + 8) x 3) for $row .. $row+11;
        print "</table>\n";
 }
 print "\n";
-:></ul>
+:></div>
 
 <hr>
 
index 6457864b5772143d1f2724b76a182188fa1c87e6..7207b03c224326127aa1e863e01487e0a9ad9880 100644 (file)
@@ -139,7 +139,7 @@ sub glyph_table {
 
 sub print_glyph_tables {
        while (@_) {
-               printf "<div><h2>%s</h2>\n\n", shift;
+               printf '<div class="section"><h2>%s</h2>'."\n\n", shift;
                while (ref $_[0] and $_ = shift) {
                        print glyph_table($_);
                }