--- loncom/xml/londefdef.pm 2010/07/21 02:00:37 1.418 +++ loncom/xml/londefdef.pm 2010/08/27 09:42:48 1.422 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.418 2010/07/21 02:00:37 www Exp $ +# $Id: londefdef.pm,v 1.422 2010/08/27 09:42:48 foxr Exp $ # # # Copyright Michigan State University Board of Trustees @@ -2048,29 +2048,39 @@ sub start_table { my $width = &Apache::lonxml::get_param('TeXwidth', $parstack, $safeeval, undef, 0); my $theme = &Apache::lonxml::get_param('TeXtheme', $parstack, $safeeval, undef, 0); my $align = &Apache::lonxml::get_param('align', $parstack, $safeeval, undef, 0); + my $cell_border = &Apache::lonxml::get_param('rules', $parstack, $safeeval, undef, 0); # The only thing that needs any figuring out is the width.. and then only if it is # a percent. If not it's assumed to be some valid TeX measurement unit e.g. 3.0cm # my $table = new Apache::lontable(); - if ($border ne '') { + if ((defined $border) && ($border > 0)) { + # &Apache::lonnet::logthis("Turning on table borders: $border"); $table->table_border(1); + if ($cell_border ne 'none') { + $table->cell_border(1); # html specs that border turns on both...unless rules='none'. + } + } + # Only all or nothing for cell borders for now: + + if ((defined $cell_border) && ($cell_border ne 'none')) { + # &Apache::lonnet::logthis("Turning on cell borders: $cell_border"); $table->cell_border(1); } - if ($theme ne '') { + if (defined $theme) { $table->theme($theme); } - if ($align ne '') { + if (defined $align) { $table->alignment($align); } # Missing width is most of page width - if ($width eq "") { + if (!(defined $width)) { $width = '70%'; } - + # If a percentage, need to calculate what this means in terms of # page width: @@ -2183,7 +2193,9 @@ sub end_table { my $table = pop(@Apache::londefdef::table); my $t = $table->generate(); + &Apache::lonnet::logthis("Generating string"); $currentstring = $t->generate_string(); + &Apache::lonnet::logthis("Generated: $currentstring"); &enable_para(); #-------------------------------------------------------------- # Old table code: