sc: unexceptional header tags for empty category cells
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 13 Jun 2015 01:44:53 +0000 (03:44 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 13 Jun 2015 01:44:53 +0000 (03:44 +0200)
Clean up code by making first column <th> for all rows.

sc.plp

diff --git a/sc.plp b/sc.plp
index 4706bbfb15f51df2d63a929de5d382a9fc5ee99b..71742280006ea0099aa6b83734bba153a15e7ac8 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -232,17 +232,15 @@ sub showval {
 
                print(
                        '<tr>',
-                       sprintf('<t%s class="cat">%s',
-                               $cat ne $_->{cat} ? ('h', $cat = $_->{cat}) : ('d', '&nbsp;')
-                       ),
-                       '<td>' . $_->{name},
+                       '<th class="cat">', $cat ne $_->{cat} && ($cat = $_->{cat}),
+                       '<td>', $_->{name},
                        showunitcols($_),
                );
 
                for my $subrow (@{ $_->{special} }) {
                        $subrow->{alt} or next;
                        print(
-                               '<tr class="alt"><td class="cat"><td>' . $subrow->{alt},
+                               '<tr class="alt"><td class="cat"><td>', $subrow->{alt},
                                showunitcols($subrow),
                        );
                }