--- loncom/xml/londefdef.pm 2007/02/27 23:44:53 1.355 +++ loncom/xml/londefdef.pm 2007/03/09 00:08:02 1.356 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.355 2007/02/27 23:44:53 foxr Exp $ +# $Id: londefdef.pm,v 1.356 2007/03/09 00:08:02 foxr Exp $ # # # Copyright Michigan State University Board of Trustees @@ -2201,17 +2201,18 @@ sub end_table { # single rowspan, columspan and combined row/colspans will # work correctly. LaTeX is delicate here. # RF. - + # Start a rowspan if necessary: - + + my $primary_col_width = $fwidth[$jn]; # Width of primary column. my $rowspan = $Apache::londefdef::table[-1]{'rowspan'}[$in][$jn]; my $colspan = $Apache::londefdef::table[-1]{'colspan'}[$in][$jn]; # # Do the appropriate magic if this has a colspan # - + + my $spanwidth = 0; if ($colspan > 1) { - my $spanwidth = 0; for (my $spancol = $jn; $spancol < $jn + $colspan; $spancol++) { $spanwidth += $fwidth[$spancol]; } @@ -2226,7 +2227,9 @@ sub end_table { else { $output .= "{|p{$spanwidth mm}|}{"; } - + + } else { + $spanwidth = $primary_col_width; # If no span width will be just colwidth } # Rowspan... if colspan is 1, and there's an alignment we'll need @@ -2246,13 +2249,17 @@ sub end_table { } } $have_rowspan++; - $output .= '\multirow{'.$rowspan.'}[0]{*}{'; + if ($multirow_aligned) { + $output .= '\multirow{'.$rowspan.'}[0]{*}{'; + } else { + $output .= '\multirow{'.$rowspan."}[0]{$spanwidth mm}{"; + } $Apache::londefdef::table[-1]{'content'}[$in][$jn] =~ s{^\s*\\par\s*}{}; $Apache::londefdef::table[-1]{'content'}[$in][$jn] =~ s{\s*\\vskip\s*0pt\s*$}{}; - + # # If we did not throw in a multicolumn to align, then add # an extra { @@ -2266,7 +2273,7 @@ sub end_table { if (($rowspan eq '^') || ($rowspan eq '_')) { $have_rowspan++; } - #-------------------------------------------------------------- + #-------------------------------------------------------------- # For right and center alignment of single cells.