*** TablePlugin.pm.orig	Tue Dec 17 23:41:40 2002
--- TablePlugin.pm	Tue Mar 25 14:43:18 2003
***************
*** 33,39 ****
          $web $topic $user $installWeb $VERSION $debug
          $insideTABLE $tableCount @curTable $sortCol $requestedTable $up
          $doBody $doAttachments $currTablePre $tableWidth @columnWidths
!         $tableBorder $cellPadding $cellSpacing $headerAlign $dataAlign $vAlign
          $headerBg $headerColor $doSort $twoCol @dataBg @dataColor @isoMonth
          $headerRows $footerRows
          @fields $upchar $downchar $diamondchar $url $curTablePre
--- 33,40 ----
          $web $topic $user $installWeb $VERSION $debug
          $insideTABLE $tableCount @curTable $sortCol $requestedTable $up
          $doBody $doAttachments $currTablePre $tableWidth @columnWidths
!         $tableBorder $tableFrame $tableRules $cellPadding $cellSpacing 
!         @headerAlign @dataAlign $vAlign
          $headerBg $headerColor $doSort $twoCol @dataBg @dataColor @isoMonth
          $headerRows $footerRows
          @fields $upchar $downchar $diamondchar $url $curTablePre
***************
*** 151,164 ****
  {
      $doSort       = $doBody;
      $tableBorder  = 1;
      $cellSpacing  = 1;
      $cellPadding  = 0;
      $tableWidth   = "";
      @columnWidths = ( );
      $headerRows   = 1;
      $footerRows   = 0;
!     $headerAlign  = "";
!     $dataAlign    = "";
      $vAlign       = "";
      $headerBg     = "#99CCCC";
      $headerColor  = "";
--- 152,167 ----
  {
      $doSort       = $doBody;
      $tableBorder  = 1;
+     $tableFrame   = "";
+     $tableRules   = "";
      $cellSpacing  = 1;
      $cellPadding  = 0;
      $tableWidth   = "";
      @columnWidths = ( );
      $headerRows   = 1;
      $footerRows   = 0;
!     @headerAlign  = ( );
!     @dataAlign    = ( );
      $vAlign       = "";
      $headerBg     = "#99CCCC";
      $headerColor  = "";
***************
*** 195,200 ****
--- 198,209 ----
      $tmp = TWiki::Func::extractNameValuePair( $args, "tableborder" );
      $tableBorder = $tmp if( $tmp ne "" );
  
+     $tmp = TWiki::Func::extractNameValuePair( $args, "tableframe" );
+     $tableFrame = $tmp if( $tmp ne "" );
+ 
+     $tmp = TWiki::Func::extractNameValuePair( $args, "tablerules" );
+     $tableRules = $tmp if( $tmp ne "" );
+ 
      $tmp = TWiki::Func::extractNameValuePair( $args, "cellpadding" );
      $cellPadding = $tmp if( $tmp ne "" );
  
***************
*** 202,211 ****
      $cellSpacing = $tmp if( $tmp ne "" );
  
      $tmp = TWiki::Func::extractNameValuePair( $args, "headeralign" );
!     $headerAlign = $tmp if( $tmp );
  
      $tmp = TWiki::Func::extractNameValuePair( $args, "dataalign" );
!     $dataAlign = $tmp if( $tmp );
  
      $tmp = TWiki::Func::extractNameValuePair( $args, "tablewidth" );
      $tableWidth = $tmp if( $tmp );
--- 211,220 ----
      $cellSpacing = $tmp if( $tmp ne "" );
  
      $tmp = TWiki::Func::extractNameValuePair( $args, "headeralign" );
!     @headerAlign = split( /,\s*/, $tmp ) if( $tmp );
  
      $tmp = TWiki::Func::extractNameValuePair( $args, "dataalign" );
!     @dataAlign = split( /,\s*/, $tmp ) if( $tmp );
  
      $tmp = TWiki::Func::extractNameValuePair( $args, "tablewidth" );
      $tableWidth = $tmp if( $tmp );
***************
*** 311,317 ****
          $attr .= ' width="' . $columnWidths[$colCount-1] . '"' if( defined $columnWidths[$colCount-1] );
          if( /^\s*\*(.*)\*\s*$/ ) {
              $value = $1;
!             $attr .= " align=\"$headerAlign\"" if $headerAlign; # override $attr
              $attr .= " valign=\"$vAlign\"" if $vAlign;
              push @row, [ $value, "$attr", "th" ];
          } else {
--- 320,330 ----
          $attr .= ' width="' . $columnWidths[$colCount-1] . '"' if( defined $columnWidths[$colCount-1] );
          if( /^\s*\*(.*)\*\s*$/ ) {
              $value = $1;
! 	    
! 	    if ( @headerAlign ) {
! 		$align = @headerAlign[($colCount - 1) % ($#headerAlign + 1) ];
! 		$attr .= " align=\"$align\""; # override $attr
! 	    }
              $attr .= " valign=\"$vAlign\"" if $vAlign;
              push @row, [ $value, "$attr", "th" ];
          } else {
***************
*** 319,325 ****
                  $_ = $1;
              }
              $value = $_;
!             $attr .= " align=\"$dataAlign\"" if $dataAlign; # override $attr
              $attr .= " valign=\"$vAlign\"" if $vAlign;
              push @row, [ $value, "$attr", "td" ];
          }
--- 332,341 ----
                  $_ = $1;
              }
              $value = $_;
! 	    if ( @dataAlign ) {
! 		$align = @dataAlign[($colCount - 1) % ($#dataAlign + 1) ];
! 		$attr .= " align=\"$align\""; # override $attr
! 	    }
              $attr .= " valign=\"$vAlign\"" if $vAlign;
              push @row, [ $value, "$attr", "td" ];
          }
***************
*** 402,409 ****
  {
      my $direction = $up ? 0 : 1;
      my $doIt = doIt( $curTable[$headerRows-1] );
!     my $text = "$currTablePre<table border=\"$tableBorder\" cellspacing=\"$cellSpacing\""
!              . " cellpadding=\"$cellPadding\"";
      $text .= " width=\"$tableWidth\"" if( $tableWidth );
      $text .= ">\n";
      my $type = "";
--- 418,427 ----
  {
      my $direction = $up ? 0 : 1;
      my $doIt = doIt( $curTable[$headerRows-1] );
!     my $text = "$currTablePre<table border=\"$tableBorder\"";
!     $text .= " frame=\"$tableFrame\"" if ( $tableFrame );
!     $text .= " cellspacing=\"$cellSpacing\" cellpadding=\"$cellPadding\"";
!     $text .= " rules=\"$tableRules\"" if ( $tableRules );
      $text .= " width=\"$tableWidth\"" if( $tableWidth );
      $text .= ">\n";
      my $type = "";
