Item13436: Adding the class parameter to the TablePlugin
Priority: Enhancement
Current State: Closed
Released In: 2.1.0
Target Release: minor
Hey
Since there was no way to give tables a class using the
TablePlugin and it was only little code, I created the following patch:
--- lib/Foswiki/Plugins/TablePlugin/Core.pm
+++ lib/Foswiki/Plugins/TablePlugin/Core.pm
@@ -313,6 +313,13 @@
. $Foswiki::Plugins::TablePlugin::topic
. ( $tableCount + 1 );
_storeAttribute( 'id', $id, $inCollection );
+ my $class =
+ defined $inParams->{class}
+ ? $defaultAttrs->{class}
+ . ' '
+ . $inParams->{class}
+ : $defaultAttrs->{class};
+ _storeAttribute( 'class', $class, $inCollection );
_storeAttribute( 'headerrows', $inParams->{headerrows}, $inCollection );
_storeAttribute( 'footerrows', $inParams->{footerrows}, $inCollection );
}
Just as the id, there will be a check if there is a class parameter and if so, just add the parameter to the default class (which is necessary for the css).
Tested on the 1.1.9 VM and the latest version of the
TablePlugin.
--
MarcKloter - 28 May 2015
Crawford, this looks simple enough and quite reasonable. Look okay for 2.1?
--
GeorgeClark - 15 Dec 2015
Sure, I don't have a problem with it. I don't think the ERP needs to know about it.
--
Main.CrawfordCurrie - 28 Dec 2015 - 07:32
MarcKloter: Thanks for the patch. I'm adding this to the
TablePlugin that will be released with Foswiki 2.1.
--
GeorgeClark - 30 Dec 2015