Diff for /loncom/xml/londefdef.pm between versions 1.202 and 1.203

version 1.202, 2004/03/12 15:21:49 version 1.203, 2004/03/15 19:19:04
Line 1795  sub start_table { Line 1795  sub start_table {
  if (not defined $TeXwidth) {   if (not defined $TeXwidth) {
     my $htmlwidth = &Apache::lonxml::get_param('width',$parstack,$safeeval,undef,1);      my $htmlwidth = &Apache::lonxml::get_param('width',$parstack,$safeeval,undef,1);
     if ($htmlwidth=~/%/) {      if ($htmlwidth=~/%/) {
                   $Apache::londefdef::table[-1]{'percent'}=1;
  $htmlwidth=~/(\d+)/;   $htmlwidth=~/(\d+)/;
  my $value=$1*$textwidth/100;   $Apache::londefdef::table[-1]{'width'}=$1*$textwidth/100;;
  $Apache::londefdef::table[-1]{'width'}=$value;  
     } else {      } else {
  $Apache::londefdef::table[-1]{'width'}=$textwidth;   $Apache::londefdef::table[-1]{'width'}=$textwidth;
     }      }
  } elsif ($TeXwidth=~/%/) {   } elsif ($TeXwidth=~/%/) {
       $Apache::londefdef::table[-1]{'percent'}=1;
     $TeXwidth=~/(\d+)/;      $TeXwidth=~/(\d+)/;
     my $value=$1*$textwidth/100;      my $value=$1*$textwidth/100;
             $Apache::londefdef::table[-1]{'width'}=$value;              $Apache::londefdef::table[-1]{'width'}=$value;
Line 1881  sub end_table { Line 1882  sub end_table {
  $length_row_final[$jn]=0.9*$available_length/$needed;   $length_row_final[$jn]=0.9*$available_length/$needed;
     }      }
  }   }
           #recalculation for the use of all available width if width is defined in %
           if ($Apache::londefdef::table[-1]{'percent'}==1) {
       my $current=0; 
       for (my $i=0;$i<=$#length_row_final;$i++) {  
    $current+=$length_row_final[$i];
       }
       my $coef=$Apache::londefdef::table[-1]{'width'}/$current;
       for (my $i=0;$i<=$#length_row_final;$i++) {  
    $length_row_final[$i]*=$coef;
       }
    }
  #fill the table   #fill the table
  for (my $in=0;$in<=$Apache::londefdef::table[-1]{'row_number'};$in++) {   for (my $in=0;$in<=$Apache::londefdef::table[-1]{'row_number'};$in++) {
     for (my $jn=0;$jn<=$#length_row_final;$jn++) {      for (my $jn=0;$jn<=$#length_row_final;$jn++) {

Removed from v.1.202  
changed lines
  Added in v.1.203


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>