*** TablePlugin.pm.orig Mon Aug 2 00:01:53 2004 --- TablePlugin.pm Tue Jun 28 09:02:55 2005 *************** *** 38,44 **** $headerRows $footerRows @fields $upchar $downchar $diamondchar $url $curTablePre @isoMonth %mon2num $initSort $initDirection $pluginAttrs $prefsAttrs ! @rowspan ); $VERSION = '1.013'; # 01 Aug 2004 --- 38,44 ---- $headerRows $footerRows @fields $upchar $downchar $diamondchar $url $curTablePre @isoMonth %mon2num $initSort $initDirection $pluginAttrs $prefsAttrs ! @rowspan %defaultClass ); $VERSION = '1.013'; # 01 Aug 2004 *************** *** 293,298 **** --- 293,299 ---- my $l2 = 0; if( ! $insideTABLE ) { @curTable = (); + %defaultClass = {}; @rowspan = (); $tableCount++; } *************** *** 312,317 **** --- 313,328 ---- $span = $1; $attr = " colspan=\"$span\"" ; } + + # Parse '|=' for applying style sheets to individual cells. + if ( s/^=(\w+)// ) { + $attr .= " class=\"$1\""; + } + elsif ( s/^\+(\w+)// ) { + $attr .= " class=\"$1\""; + $defaultClass{scalar(@curTable)} = $1; + } + s/^\s+$/   /o; /^(\s*).*?(\s*)$/; $l1 = length( $1 || "" ); *************** *** 458,463 **** --- 469,475 ---- my $type = ""; my $attr = ""; my $stype = ""; + my $bgClass = ""; #Flush out any remaining rowspans for (my $i = 0; $i < @rowspan; $i++) { *************** *** 520,526 **** --- 532,541 ---- my $resetCountNeeded = 0; my $arrow = ""; my $color = ""; + my $bgClass=""; foreach my $row ( @curTable ) { + $bgClass = $defaultClass{$rowCount} if ( exists($defaultClass{$rowCount}) ); + $text .= "$currTablePre"; my $colCount = 0; foreach my $fcell ( @$row ) { *************** *** 529,535 **** $type = $fcell->[2]; my $cell = $fcell->[0]; my $attr = $fcell->[1]; ! if( $type eq "th" ) { # reset data color count to start with first color after each table heading $dataColorCount = 0 if( $resetCountNeeded ); $resetCountNeeded = 0; --- 544,551 ---- $type = $fcell->[2]; my $cell = $fcell->[0]; my $attr = $fcell->[1]; ! ! if( $type eq "th" ) { # reset data color count to start with first color after each table heading $dataColorCount = 0 if( $resetCountNeeded ); $resetCountNeeded = 0; *************** *** 584,590 **** } else { $resetCountNeeded = 1 if( $colCount == 0 ); ! if( @dataBg ) { $color = $dataBg[$dataColorCount % ($#dataBg + 1) ]; $attr .= " bgcolor=\"$color\"" unless( $color =~ /none/i ); } --- 600,609 ---- } else { $resetCountNeeded = 1 if( $colCount == 0 ); ! if ( ($bgClass ne "") and ($dataColorCount % 2) ) { ! $attr .= " class=\"$bgClass\""; ! } ! if( @dataBg ) { $color = $dataBg[$dataColorCount % ($#dataBg + 1) ]; $attr .= " bgcolor=\"$color\"" unless( $color =~ /none/i ); }