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
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