Tags:
create new tag
view all tags
Hi there, I made some slight changes to the Tableplugin. I always wanted some tables to cover 100% of the pagewidth, so I wrote an enhancement for the Plugin.

Not much, but may be of some value to others smile

New attributes of the %TABLE{...} statement are:

  • tablewidth="100%" or whatever is correct within HTML
  • columnwidths="10,20,15%,,30%" for the appropriate columns

The diff can be seen here:

35c35
<         $doBody $doAttachments $currTablePre
---
>         $doBody $doAttachments $currTablePre $tableWidth $columnWidths
118a119,120
>     $columnWidths= &TWiki::Func::getPreferencesValue( "TABLEPLUGIN_COLUMNWIDTHS" )|| "";
>     $tableWidth  = &TWiki::Func::getPreferencesValue( "TABLEPLUGIN_TABLEWIDTH" )  || "";
173a176
>     my @colWidths = split ( /,/, $columnWidths);
197a201
>           $attr .= ' width="'.$colWidths[$colCount-1].'" ' if defined $colWidths[$colCount-1];
205a210
>           $attr .= ' width="'.$colWidths[$colCount-1].'" ' if defined $colWidths[$colCount-1];
287c292,293
<     my $text = "$currTablePre<table border=\"$tableBorder\" "
---
>     my $text = "$currTablePre<table border=\"$tableBorder\" "
>              . ( ($tableWidth ne "") ? " width=\"$tableWidth\" " : "" )
424a431,436
>
>     $tmp = &TWiki::Func::extractNameValuePair( $args, "tablewidth" );
>     $tableWidth = $tmp if( $tmp );
>
>     $tmp = &TWiki::Func::extractNameValuePair( $args, "columnwidths" );
>     $columnWidths = $tmp if( $tmp );

-- ThorstenSommermann - 12 Nov 2002

This is now in the latest TablePlugin with some modifications. Thanks for the contribution!

-- PeterThoeny - 15 Dec 2002


Category: TWikiPatches
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2002-12-15 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.