Document support for address lookup
[infodrom.org/www.infodrom.org] / Styles / tableutils.pl
1 <:
2
3   # @_ ist ein Array, dessen *letztes* Element die Anzahl
4   # der Elemente enthaelt
5   #
6   sub web_calc_table_width
7   {
8       local ($count) = pop(@_);
9       local (@widths) = @_;
10       local ($i);
11       local ($mod);
12       local ($tabwidth) = 0;
13
14       foreach $i (@widths) {
15           $tabwidth = $i if ((($count) % $i) == 0);
16       }
17       if (!$tabwidth) {
18           foreach $i (@widths) {
19               $tabwidth = $i if ((($count) % $i) > $mod);
20               $mod = ($count) % $i;
21           }
22       }
23       return $tabwidth;
24   }
25
26 :>