Simplified all <table/>s centering by using new css rule: class="margin-center"
[www.jankratochvil.net.git] / project / Lib.pm
index 86c900f..e48b92a 100644 (file)
@@ -318,37 +318,35 @@ sub platforms ($;$%)
 my($class,$platform_selected,%args)=@_;
 
        my $r="";
-       $r.='<table border="0" width="100%"><tr><td align="center">'."\n";
-               $r.='<table><tr>'."\n";
-                       $r.='<td>';
-                               $r.='<table border="1" style="border-collapse: collapse; border-style: solid; border-width: 1px;">'."\n";
-                                       $r.='<tr>'."\n";
-                                               $r.='<td style="padding: 5px; font-weight: bold;">'."\n";
-                                                       $r.='Projects';
-                                               $r.='</td>'."\n";
-                                       $r.='</tr>'."\n";
-                               $r.='</table>';
-                       $r.='</td>';
-                       $r.='<td>';
-                               $r.='<table border="1" style="border-collapse: collapse; border-style: solid;">'."\n";
-                                       $r.='<tr>'."\n";
-                                               my @platforms=@platforms;
-                                               while (@platforms) {
-                                                       my $platform_sym =shift @platforms;
-                                                       my $platform_name=shift @platforms;
-                                                       my $chosen=($platform_selected && $platform_selected eq $platform_sym);
-                                                       $r.='<td style="padding: 5px;">';
-                                                               $r.=a_href((!$platform_selected ? "" : "/project/").'#'.$platform_sym,$platform_name,
-                                                                               "attr"=>($chosen
-                                                                                               ? 'style="text-decoration: underline; font-weight: bold;"'
-                                                                                               : 'style="text-decoration: inherit; /* revoke underline */"'));
-                                                       $r.="</td>\n";
-                                                       }
-                                       $r.='</tr>'."\n";
-                               $r.='</table>'."\n";
-                       $r.='</td>'."\n";
-               $r.='</tr></table>'."\n";
-       $r.='</td></tr></table>'."\n";
+       $r.='<table border="0" class="margin-center"><tr>'."\n";
+               $r.='<td>';
+                       $r.='<table border="1" style="border-collapse: collapse; border-style: solid; border-width: 1px;">'."\n";
+                               $r.='<tr>'."\n";
+                                       $r.='<td style="padding: 5px; font-weight: bold;">'."\n";
+                                               $r.='Projects';
+                                       $r.='</td>'."\n";
+                               $r.='</tr>'."\n";
+                       $r.='</table>';
+               $r.='</td>';
+               $r.='<td>';
+                       $r.='<table border="1" style="border-collapse: collapse; border-style: solid;">'."\n";
+                               $r.='<tr>'."\n";
+                                       my @platforms=@platforms;
+                                       while (@platforms) {
+                                               my $platform_sym =shift @platforms;
+                                               my $platform_name=shift @platforms;
+                                               my $chosen=($platform_selected && $platform_selected eq $platform_sym);
+                                               $r.='<td style="padding: 5px;">';
+                                                       $r.=a_href((!$platform_selected ? "" : "/project/").'#'.$platform_sym,$platform_name,
+                                                                       "attr"=>($chosen
+                                                                                       ? 'style="text-decoration: underline; font-weight: bold;"'
+                                                                                       : 'style="text-decoration: inherit; /* revoke underline */"'));
+                                               $r.="</td>\n";
+                                               }
+                               $r.='</tr>'."\n";
+                       $r.='</table>'."\n";
+               $r.='</td>'."\n";
+       $r.='</tr></table>'."\n";
        if (!$args{"novskip"}) {
                $r.="<hr />\n";
                $r.=My::Web::vskip "6ex";
@@ -366,13 +364,11 @@ my($class,$name)=@_;
 
        print $class->platforms($item->{"platform"},"novskip"=>1);
 
-       $r.='<table border="0" width="100%"><tr><td align="center">'."\n";
-               $r.='<table border="1" style="border-collapse: collapse; border-style: solid;">'."\n";
-                       $r.='<tr><td style="font-size: larger;">'."\n";
-                               $r.=a_href "/project/$name/",$title;
-                       $r.='</td></tr>'."\n";
-               $r.='</table>'."\n";
-       $r.='</td></tr></table>'."\n";
+       $r.='<table border="1" style="border-collapse: collapse; border-style: solid;" class="margin-center">'."\n";
+               $r.='<tr><td style="font-size: larger;">'."\n";
+                       $r.=a_href "/project/$name/",$title;
+               $r.='</td></tr>'."\n";
+       $r.='</table>'."\n";
        $r.=vskip "1ex";
        return $r;
 }