--- loncom/xml/londefdef.pm 2007/03/22 22:34:23 1.361 +++ loncom/xml/londefdef.pm 2007/04/06 10:23:46 1.362 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.361 2007/03/22 22:34:23 foxr Exp $ +# $Id: londefdef.pm,v 1.362 2007/04/06 10:23:46 foxr Exp $ # # # Copyright Michigan State University Board of Trustees @@ -1987,12 +1987,19 @@ sub start_table { } } else { $Apache::londefdef::table[-1]{'forcedtablewidth'} = 1; - } + } + # This stuff looks a bit hokey.. + # Percentage width is actually given as an absolute width.. + # but it appears that unless the 'percent' flag is set, + # The table is just allowed to go to its natural width + # for now let's always claim 'percent' is set.. + # if ($TeXwidth=~/%/) { $Apache::londefdef::table[-1]{'percent'}=1; $TeXwidth=~/(\d+)/; $Apache::londefdef::table[-1]{'width'}=$1*$textwidth/100; } else { + $Apache::londefdef::table[-1]{'percent'} = 1; # kludge until we get the intent. $Apache::londefdef::table[-1]{'width'}=$TeXwidth; } # In the end, however the table width cannot be wider than $textwidth... @@ -2000,7 +2007,6 @@ sub start_table { if ($Apache::londefdef::table[-1]{'width'} > $textwidth) { $Apache::londefdef::table[-1]{'width'} = $textwidth; } - #table's border my $border = &Apache::lonxml::get_param('border',$parstack,$safeeval); my $permission=&Apache::lonxml::get_param('TeXDropEmptyColumns',$parstack,$safeeval,undef,0); @@ -2141,6 +2147,7 @@ sub end_table { $space_neeeded=$space_neeeded+$max_len[$jn]; } if ($space_neeeded<=$available_space) { + for (my $jn=0;$jn<=$#max_len;$jn++) { if ($fwidth[$jn]==0) { $fwidth[$jn]=$max_len[$jn];