[ic] table-organise question/gripe

Peter peter at pajamian.dhs.org
Mon Oct 24 23:12:19 EDT 2005


On 10/24/2005 07:05 PM, Mike Heins wrote:
> Quoting Peter (peter at pajamian.dhs.org):
> 
>>I'd like to be able to use table-organise with the rows attribute but 
>>without the table attribute, unfortunately the code for table-organise 
>>explicitly does not allow this and has a line added in to prevent it. 
>>Any particular reason why this is the case?
> 
> 
> I don't know why I did that -- or even if I did, because while I wrote
> the tag originally there have been others working on it.
> 
> I would think we could change it to:
> 
>      $opt->{table} = ' ' if ! $opt->{table} and ! $opt->{no_table};

There's a nother bug when using the rows and columnize attributes 
together (in order to be able to line up images and text across the 
table).  The last row gets messed up if there's not an even number of 
cell blocks (for lack of a better term) in it.

Here's a diff that includes both referenced bug fixes (probably suffers 
from word-wrap so best to implement manually)...

--- table_organize.tag  2004-05-05 06:53:36.000000000 -0700
+++ my_table_organize.tag       2005-10-24 20:01:59.730421762 -0700
@@ -28,7 +28,7 @@

  =item rows

-Optional number of rows. Implies "table" parameter.
+Optional number of rows. Implies "table" parameter unless no_table is set.

  =item table

@@ -256,11 +256,15 @@
                 $total_mod = $rows * $cols;
                 @rest = splice(@cells, $total_mod)
                         if $total_mod < @cells;
-               $opt->{table} = ' ' if ! $opt->{table};
+               $opt->{table} = ' ' if ! $opt->{table} and 
!$opt->{no_table};
         }

         my $joiner = $opt->{joiner} || ($pretty ? "\n\t\t" : "");
         while(@cells) {
+               while (scalar(@cells) % (($rows||1)*$cols)) {
+                       push @cells, "<td>$opt->{filler}</td>";
+               }
+
                 if ($opt->{columnize}) {
                         my $cell_count = scalar @cells;
                         my $row_count_ceil = POSIX::ceil($cell_count / 
$cols);
@@ -282,10 +286,6 @@
                         }
                 }

-               while (scalar(@cells) % $cols) {
-                       push @cells, "<td>$opt->{filler}</td>";
-               }
-
                 #$out .= "<!-- starting table tmod=$tmod -->";
                 if($opt->{table}) {
                         $out .= "<table$opt->{table}>";


More information about the interchange-users mailing list