dieren: full width table, image styling and alt
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 23 Nov 2019 15:05:32 +0000 (16:05 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 6 May 2020 01:18:07 +0000 (03:18 +0200)
dieren.plp

index 67525c421175917012d24de167f449c5cd34215b..cb2039195780ea5fdbc1cb6db583b6ed460f3de0 100644 (file)
@@ -9,6 +9,20 @@ Html({
                relatie vernoemd vernoeming combinatie samenstelling onverwant
                land zee lucht  animals dutch language
        '],
+       raw => <<'EOT',
+<style>
+table {
+       width: 100%;
+}
+tr:first-child th {
+       word-break: break-all;
+}
+img {
+       vertical-align: bottom;
+       width: 100%;
+}
+</style>
+EOT
 });
 
 :>
@@ -48,7 +62,7 @@ for my $name (@table) {
        print qq{<td title="$name">};
        if (-e (my $img = "data/dieren/$name.jpg")) {
                printf '<img src="/%s"', $img;
-               printf ' alt="%s"', $name;
+               printf ' alt="%s"', -l $img ? readlink($img) =~ s/\.jpg$//r : $name;
                print ' />';
        }
        print '</td>';