--- stattrans.old.pl	2005-11-06 16:32:49.187500000 +0100
+++ stattrans.pl	2005-11-06 22:15:32.406250000 +0100
@@ -77,9 +77,9 @@
 $max_versions = 5;
 $min_versions = 1;
 
-$border_head = "<table width=\"95%\" align=\"center\" border=0 cellpadding=0 cellspacing=0><tr bgcolor=\"#000000\"><td>"
-              ."<table width=\"100%\" border=0 cellpadding=0 cellspacing=1><tr bgcolor=\"#ffffff\"><td>";
-$border_foot = "</td></tr></table></td></tr></table>";
+$border_head = "<div style=\"text-align: center; width: 95%; background-color: #000000\">\n"
+              ."<table width=\"100%\" border=0 cellpadding=0 cellspacing=1><tr style=\"background-color: #ffffff\"><td>";
+$border_foot = "</td></tr></table>\n</div>\n";
 
 
 $date = strftime "%a %b %e %H:%M:%S %Y %z", localtime;
@@ -326,10 +326,10 @@
                 } else {
                     if (($file !~ /\.wml$/) 
                         || ($file eq "devel/wnpp/wnpp.wml")) {
-                        $t_body .= sprintf "%s<br>\n", $file;
+                        $t_body .= sprintf "%s<br />\n", $file;
                     } else {
                         (my $base = $file) =~ s/\.wml$//;
-                        $t_body .= sprintf "<a href=\"/%s.%s.html\">%s</a><br>\n", $base, $l, $base;
+                        $t_body .= sprintf "<a href=\"/%s.%s.html\">%s</a><br />\n", $base, $l, $base;
                     }
                 }
             }
@@ -340,7 +340,7 @@
                     $u_body .= sprintf "<tr><td>%s</td><td>&nbsp;</td></tr>\n", $file;
                 } else {
                     (my $base = $file) =~ s/\.wml$//;
-                    $u_body .= sprintf "<tr><td><a href=\"/%s\">%s</a></td><td align=\"right\">%d</td><td>(%.2f&nbsp;&permil;)</td></tr>\n", $base, $base, $sizes{$file}, int($sizes{$file}/$nsize * 100000 + .5) / 100;
+                    $u_body .= sprintf "<tr><td><a href=\"/%s\">%s</a></td><td align=right>%d</td><td>(%.2f&nbsp;&permil;)</td></tr>\n", $base, $base, $sizes{$file}, int($sizes{$file}/$nsize * 100000 + .5) / 100;
                 }
                 $untranslated{$lang}++;
 		$untranslated_s{$lang} += $sizes{$file};
@@ -376,26 +376,26 @@
 	$percent_us{$lang} = 100 - $percent_as{$lang};
     
         if (open (HTML, ">$config{'htmldir'}/$l.html")) {
-            printf HTML "<html><head><title>%s: %s</title></head><body bgcolor=\"#ffffff\">\n", $config{'title'}, ucfirst $lang;
+            printf HTML "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n"
+	    printf HTML "<html>\n<head>\n"
+	    printf HTML "  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n"
+	    printf HTML "  <title>%s: %s</title>\n</head>\n<body>\n", $config{'title'}, ucfirst $lang;
     
             $color = get_color ($percent_a{$lang});
     
-            print HTML "<a name=\"top\"></a>\n";
-            printf HTML "<table width=\"100%%\" cellpadding=2 cellspacing=0 bgcolor=\"%s\">\n", $color;
-    
-            printf HTML "<tr><td colspan=4><h1 align=\"center\">%s: %s</h1></td></tr>", $config{'title'}, ucfirst $lang;
-    
+	    printf HTML "<table width=\"100%%\" cellpadding=2 cellspacing=0 style=\"background-color: #%s\">\n", $color;
+	    printf HTML "<tr>\n  <td colspan=4 align=center><h1><a name=\"top\">%s: %s</a></h1></td>\n</tr>\n", $config{'title'}, ucfirst $lang;
             print HTML "<tr>\n";
-            printf HTML "<td align=\"center\" width=\"25%%\"><b>%d files (%d%%) translated</b></td>",     $wml{$lang},          $percent_a{$lang};
-            printf HTML "<td align=\"center\" width=\"25%%\"><b>%d files (%d%%) up to date</b></td>",     $translated{$lang},   $percent_t{$lang};
-            printf HTML "<td align=\"center\" width=\"25%%\"><b>%d files (%d%%) outdated</b></td>",       $outdated{$lang},     $percent_o{$lang};
-            printf HTML "<td align=\"center\" width=\"25%%\"><b>%d files (%d%%) not translated</b></td>", $untranslated{$lang}, $percent_u{$lang};
+            printf HTML "  <td align=center style=\"width: 25%%\"><b>%d files (%d%%) translated</b></td>\n",     $wml{$lang},          $percent_a{$lang};
+            printf HTML "  <td align=center style=\"width: 25%%\"><b>%d files (%d%%) up to date</b></td>\n",     $translated{$lang},   $percent_t{$lang};
+            printf HTML "  <td align=center style=\"width: 25%%\"><b>%d files (%d%%) outdated</b></td>\n",       $outdated{$lang},     $percent_o{$lang};
+            printf HTML "  <td align=center style=\"width: 25%%\"><b>%d files (%d%%) not translated</b></td>\n", $untranslated{$lang}, $percent_u{$lang};
             print HTML "</tr>\n";
 	    print HTML "<tr>\n";
-	    printf HTML "<td align=\"center\" width=\"25%%\"><b>%d bytes (%.1f%%) translated</b></td>",     $wml_s{$lang},        $percent_as{$lang};
-	    printf HTML "<td align=\"center\" width=\"25%%\"><b>%d bytes (%.1f%%) up to date</b></td>",     $translated_s{$lang}, $percent_ts{$lang};
-	    printf HTML "<td align=\"center\" width=\"25%%\"><b>%d bytes (%.1f%%) outdated</b></td>",       $outdated_s{$lang},   $percent_os{$lang};
-	    printf HTML "<td align=\"center\" width=\"25%%\"><b>%d bytes (%.1f%%) not translated</b></td>", $nsize-$wml_s{$lang}, $percent_us{$lang};
+	    printf HTML "  <td align=center style=\"width: 25%%\"><b>%d bytes (%.1f%%) translated</b></td>\n",     $wml_s{$lang},        $percent_as{$lang};
+	    printf HTML "  <td align=center style=\"width: 25%%\"><b>%d bytes (%.1f%%) up to date</b></td>\n",     $translated_s{$lang}, $percent_ts{$lang};
+	    printf HTML "  <td align=center style=\"width: 25%%\"><b>%d bytes (%.1f%%) outdated</b></td>\n",       $outdated_s{$lang},   $percent_os{$lang};
+	    printf HTML "  <td align=center style=\"width: 25%%\"><b>%d bytes (%.1f%%) not translated</b></td>\n", $nsize-$wml_s{$lang}, $percent_us{$lang};
 	    print HTML "</tr>\n";
             print HTML "</table>\n";
     
@@ -439,7 +439,9 @@
             }
             if ($t_body) {
                 print HTML "<h3><a name='uptodate'>Translations up to date</a>: <a href='#top'>(top)</a></h3>\n";
+		print HTML "<p>\n";
                 print HTML $t_body;
+		print HTML "</p>\n";
             }
             # outputs the gettext stats
             if ($lang ne 'english') {
@@ -456,27 +458,27 @@
                     $color_u = get_color (100 - $percent_po_u{$domain}{$lang});
                     
                     print HTML "<td>$domain.$langs{$lang}.po</td>";
-                    printf HTML "<td bgcolor=\"%s\" align=right>%d (%s%%)</td>", $color_t, $po_translated{$domain}{$lang},   $percent_po_t{$domain}{$lang};
-                    printf HTML "<td bgcolor=\"%s\" align=right>%d (%s%%)</td>", $color_f, $po_fuzzy{$domain}{$lang},        $percent_po_f{$domain}{$lang};
-                    printf HTML "<td bgcolor=\"%s\" align=right>%d (%s%%)</td>", $color_u, $po_untranslated{$domain}{$lang}, $percent_po_u{$domain}{$lang};
+                    printf HTML "<td style=\"background-color: #%s\" align=right>%d (%s%%)</td>", $color_t, $po_translated{$domain}{$lang},   $percent_po_t{$domain}{$lang};
+                    printf HTML "<td style=\"background-color: #%s\" align=right>%d (%s%%)</td>", $color_f, $po_fuzzy{$domain}{$lang},        $percent_po_f{$domain}{$lang};
+                    printf HTML "<td style=\"background-color: #%s\" align=right>%d (%s%%)</td>", $color_u, $po_untranslated{$domain}{$lang}, $percent_po_u{$domain}{$lang};
                     printf HTML "<td align=right>%d</td>", $po_total{$domain};
                     print HTML "</tr>\n";
                 }
-                print HTML "<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><th>Total:</th>";
+                print HTML "<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>\n<tr><th>Total:</th>";
                 $color_t = get_color ($percent_po_t{'total'}{$lang});
                 $color_f = get_color (100 - $percent_po_f{'total'}{$lang});
                 $color_u = get_color (100 - $percent_po_u{'total'}{$lang});
-                printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_t, $po_translated{'total'}{$lang}, $percent_po_t{'total'}{$lang};
-                printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_f, $po_fuzzy{'total'}{$lang}, $percent_po_f{'total'}{$lang};
-                printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_u, $po_untranslated{'total'}{$lang}, $percent_po_u{'total'}{$lang};
+                printf HTML "<td style=\"background-color: #%s\" align=right>%d (%d%%)</td>", $color_t, $po_translated{'total'}{$lang}, $percent_po_t{'total'}{$lang};
+                printf HTML "<td style=\"background-color: #%s\" align=right>%d (%d%%)</td>", $color_f, $po_fuzzy{'total'}{$lang}, $percent_po_f{'total'}{$lang};
+                printf HTML "<td style=\"background-color: #%s\" align=right>%d (%d%%)</td>", $color_u, $po_untranslated{'total'}{$lang}, $percent_po_u{'total'}{$lang};
                 printf HTML "<td align=right>%d</td>", $po_total{'total'};
                 print HTML "</tr>\n";
             }
             print HTML "</table>\n";
             
             # outputs footer
-            print HTML "<hr><address>Compiled at $date</address>\n";
-            print HTML "</body></html>";
+            print HTML "<hr/>\n<address>Compiled at $date</address>\n";
+            print HTML "</body>\n</html>\n";
             close (HTML);
         }
     }
@@ -489,14 +491,18 @@
 open (HTML, ">$config{'htmldir'}/index.html")
     || die "Can't open $config{'htmldir'}/index.html";
 
-printf HTML "<html>\n<head><title>%s</title></head>\n<body bgcolor=\"#ffffff\">\n", $config{'title'};
-printf HTML "<h1 align=\"center\">%s</h1>\n", $config{'title'};
+printf HTML "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n"
+printf HTML "  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n"
+printf HTML "  <title>%s</title>\n</head>\n<body>\n", $config{'title'};
+printf HTML "</head>\n<body>\n"
+
+printf HTML "<h1 style=\"text-align: center\">%s</h1>\n", $config{'title'};
 
 print HTML "<h2>Translated web pages</h2>\n";
 printf HTML "<p>There are %d pages to translate.</p>\n",($wml{'english'}+$untranslated{'english'});
 
 print HTML $border_head;
-print HTML "<table width=\"100%\" border=0 bgcolor=\"#cdc9c9\">\n";
+print HTML "<table width=\"100%\" border=0 style=\"background-color: #cdc9c9\">\n";
 print HTML "<tr><th>Language</th><th colspan=\"2\">Translations</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Outdated</th><th colspan=\"2\">Not translated</th></tr>\n";
 foreach $lang (@search_in) {
     my @processed_langs = ($langs{$lang});
@@ -509,10 +515,10 @@
 
         print HTML "<tr>";
         printf HTML "<td><a href=\"%s.html\">%s</a> (%s)</td>", $l, ucfirst $lang, $l;
-        printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_a, $wml{$lang},          format3($percent_a{$lang});
-        printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_t, $translated{$lang},   format3($percent_t{$lang});
-        printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_o, $outdated{$lang},     format3($percent_o{$lang});
-        printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_u, $untranslated{$lang}, format3($percent_u{$lang});
+        printf HTML "<td style=\"background-color: #%s\" align=right>%d</td><td>(%s%%)</td>", $color_a, $wml{$lang},          format3($percent_a{$lang});
+        printf HTML "<td style=\"background-color: #%s\" align=right>%d</td><td>(%s%%)</td>", $color_t, $translated{$lang},   format3($percent_t{$lang});
+        printf HTML "<td style=\"background-color: #%s\" align=right>%d</td><td>(%s%%)</td>", $color_o, $outdated{$lang},     format3($percent_o{$lang});
+        printf HTML "<td style=\"background-color: #%s\" align=right>%d</td><td>(%s%%)</td>", $color_u, $untranslated{$lang}, format3($percent_u{$lang});
         print HTML "</tr>\n";
     }
 }
@@ -523,7 +529,7 @@
 printf HTML "<p>There are %d bytes to translate.</p>\n",($wml_s{'english'}+$untranslated_s{'english'});
 
 print HTML $border_head;
-print HTML "<table width=\"100%\" border=0 bgcolor=\"#cdc9c9\">\n";
+print HTML "<table width=\"100%\" border=0 style=\"background-color: #cdc9c9\">\n";
 print HTML "<tr><th>Language</th><th colspan=\"2\">Translations</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Outdated</th><th colspan=\"2\">Not translated</th></tr>\n";
 
 foreach $lang (@search_in) {
@@ -537,10 +543,10 @@
 
 	print HTML "<tr>";
 	printf HTML "<td><a href=\"%s.html\">%s</a> (%s)</td>", $l, ucfirst $lang, $l;
-	printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_a, $wml_s{$lang},                   format5($percent_as{$lang});
-	printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_t, $translated_s{$lang},            format5($percent_ts{$lang});
-	printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_o, $outdated_s{$lang},              format5($percent_os{$lang});
-	printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_u, $wml_s{"english"}+$untranslated_s{'english'}-$wml_s{$lang}, format5($percent_us{$lang});
+	printf HTML "<td style=\"background-color: #%s\" align=right>%d</td><td>(%s%%)</td>", $color_a, $wml_s{$lang},                   format5($percent_as{$lang});
+	printf HTML "<td style=\"background-color: #%s\" align=right>%d</td><td>(%s%%)</td>", $color_t, $translated_s{$lang},            format5($percent_ts{$lang});
+	printf HTML "<td style=\"background-color: #%s\" align=right>%d</td><td>(%s%%)</td>", $color_o, $outdated_s{$lang},              format5($percent_os{$lang});
+	printf HTML "<td style=\"background-color: #%s\" align=right>%d</td><td>(%s%%)</td>", $color_u, $wml_s{"english"}+$untranslated_s{'english'}-$wml_s{$lang}, format5($percent_us{$lang});
 	print HTML "</tr>\n";
     }
 }
@@ -550,7 +556,7 @@
 print HTML "<h2>Translated templates (gettext files)</h2>\n";
 printf HTML "<p>There are %d strings to translate.</p>\n",$po_total{'total'};
 print HTML $border_head;
-print HTML "<table width=\"100%\" border=0 bgcolor=\"#cdc9c9\">\n";
+print HTML "<table width=\"100%\" border=0 style=\"background-color: #cdc9c9\">\n";
 print HTML "<tr><th>Language</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Fuzzy</th><th colspan=\"2\">Not translated</th></tr>\n";
 foreach $lang (@search_in) {
     next if $lang eq 'english';
@@ -562,9 +568,9 @@
         $color_t = get_color ($percent_po_t{'total'}{$lang});
         $color_f = get_color (100 - $percent_po_f{'total'}{$lang});
         $color_u = get_color (100 - $percent_po_u{'total'}{$lang});
-        printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_t, $po_translated{'total'}{$lang},   format3($percent_po_t{'total'}{$lang});
-        printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_f, $po_fuzzy{'total'}{$lang},        format3($percent_po_f{'total'}{$lang});
-        printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_u, $po_untranslated{'total'}{$lang}, format3($percent_po_u{'total'}{$lang});
+        printf HTML "<td style=\"background-color: #%s\" align=right>%d</td><td>(%s%%)</td>", $color_t, $po_translated{'total'}{$lang},   format3($percent_po_t{'total'}{$lang});
+        printf HTML "<td style=\"background-color: #%s\" align=right>%d</td><td>(%s%%)</td>", $color_f, $po_fuzzy{'total'}{$lang},        format3($percent_po_f{'total'}{$lang});
+        printf HTML "<td style=\"background-color: #%s\" align=right>%d</td><td>(%s%%)</td>", $color_u, $po_untranslated{'total'}{$lang}, format3($percent_po_u{'total'}{$lang});
         print HTML "</tr>\n";
     }
 }
@@ -572,9 +578,9 @@
 print HTML "</table>\n";
 print HTML $border_foot;
 
-print HTML "<p><hr noshade size=1 width=\"100%\">\n";
+print HTML "<hr />\n";
 print HTML "<p>Created with <a href=\"http://cvs.debian.org/webwml/stattrans.pl?cvsroot=webwml\">webwml-stattrans</a> at $date\n";
-print HTML "</body></html>\n";
+print HTML "</body>\n</html>\n";
 close (HTML);
 
 print "done.\n" if ($config{'verbose'});
