Permalink
Browse files

Item14574: fixed cellspacing, cellpadding ...

and tableborder using css properties instead of html attributes now
  • Loading branch information...
MichaelDaum committed Dec 12, 2017
1 parent d9c5e1e commit 376bfd55ea67ceb546fd498d4f8bedd3d76dfbc2
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1454519814" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1513079351" format="1.1" version="1"}%
%META:TOPICPARENT{name="Plugins"}%
---+ Table Plugin
@@ -193,6 +193,7 @@ Sort icons in the header are read from %SYSTEMWEB%.DocumentGraphics.
%TABLE{columnwidths="10%,90%"}%
| Change History: | <!-- specify latest version first -->&nbsp; |
| 12 Dec 2017 | 1.160: Foswikitask:Item14574 - fixed cellspacing, cellpadding and tableborder using css properties instead of html attributes now |
| 03 Feb 2016 | 1.154: Foswikitask:Item13881 - Unicode column heading are incorrectly encoded,<br/>\
Foswikitask:Item13405 - Unicode NFC normalization |
| 30 Dec 2015 | 1.153: Foswikitask:Item13436 - Add class parameter to the TABLE macro to permit custom class specifications. |
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1451454504" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1513079351" format="1.1" version="1"}%
%META:TOPICPARENT{name="Macros"}%
---+ TABLE -- control attributes of tables and sorting of table columns
The =%<nop>TABLE{}%= macro is handled by the TablePlugin
@@ -7,7 +7,7 @@ The =%<nop>TABLE{}%= macro is handled by the TablePlugin
%TABLE{tablewidth="100%" columnwidths="10%,45%,20%,25%" sort="off" headerbg="#f5f5f5" databg="#ffffff" headercolor="#333333"}%
| *Parameter* | *Description* | *Default* | *Example* |
| =tableborder= | Table border width (pixels). | ="1"= | =tableborder="2"= |
| =tablebordercolor= | Table border color . Is only visible when =cellspacing= is larger than 1, or =cellborder= is =0=, or =tablerules= is =none=, otherwise the cell borders overlap the table border. | <span class="foswikiGrayText">unspecified</span> | =tablebordercolor="#333"= |
| =tablebordercolor= | Table border color. | <span class="foswikiGrayText">unspecified</span> | =tablebordercolor="#333"= |
| =tableframe= | Table frame, set to ="void"= (no sides), ="above"= (the top side only), ="below"= (the bottom side only), ="hsides"= (the top and bottom sides only), ="lhs"= (the left-hand side only), ="rhs"= (the right-hand side only), ="vsides"= (the right and left sides only), ="box"= (all four sides), ="border"= (all four sides). | <span class="foswikiGrayText">unspecified</span> | =tableframe="hsides"= |
| =tablerules= | Table rules, set to ="none"= (no rules), ="groups"= (rules will appear between row groups and column groups only), ="rows"= (rules will appear between rows only), ="cols"= (rules will appear between columns only), ="all"= (rules will appear between all rows and columns). See also: =headerrules= and =datarules=. | <span class="foswikiGrayText">unspecified</span> | =tablerules="rows"= |
| =tablewidth= | Table width: percentage of window width, or absolute pixel value. | <span class="foswikiGrayText">unspecified</span> | =tablewidth="100%"= |
@@ -1110,15 +1110,9 @@ sub _createCssStyles {
if ( defined $inAttrs->{tableBorderColor} ) {
my $attr;
$attr = 'border-color:' . $inAttrs->{tableBorderColor};
&$setAttribute( $tableSelector, '', $attr );
$attr = 'border-top-color:' . $inAttrs->{tableBorderColor};
&$setAttribute( $tableSelector, '', $attr );
$attr = 'border-bottom-color:' . $inAttrs->{tableBorderColor};
&$setAttribute( $tableSelector, '', $attr );
$attr = 'border-left-color:' . $inAttrs->{tableBorderColor};
&$setAttribute( $tableSelector, '', $attr );
$attr = 'border-right-color:' . $inAttrs->{tableBorderColor};
&$setAttribute( $tableSelector, '', $attr );
&$setAttribute( $tableSelector, '', $attr );
&$setAttribute( $tableSelector, 'td', $attr );
&$setAttribute( $tableSelector, 'th', $attr );
}
# cellSpacing
@@ -1127,6 +1121,9 @@ sub _createCssStyles {
# do not use border-collapse:collapse
my $attr = 'border-collapse:separate';
&$setAttribute( $tableSelector, '', $attr );
$attr =
'border-spacing:' . addDefaultSizeUnit( $inAttrs->{cellspacing} );
&$setAttribute( $tableSelector, '', $attr );
}
# cellpadding
@@ -1142,6 +1139,9 @@ sub _createCssStyles {
my $attr = 'border-width:' . addDefaultSizeUnit($cellBorderWidth);
&$setAttribute( $tableSelector, 'td', $attr );
&$setAttribute( $tableSelector, 'th', $attr );
$attr = "border-style:solid";
&$setAttribute( $tableSelector, 'td', $attr );
&$setAttribute( $tableSelector, 'th', $attr );
}
# tablewidth
@@ -1415,11 +1415,8 @@ sub emitTable {
}
my $tableTagAttributes = {};
$tableTagAttributes->{class} = $combinedTableAttrs->{class};
$tableTagAttributes->{border} = $combinedTableAttrs->{border};
$tableTagAttributes->{cellspacing} = $combinedTableAttrs->{cellspacing};
$tableTagAttributes->{cellpadding} = $combinedTableAttrs->{cellpadding};
$tableTagAttributes->{id} = $combinedTableAttrs->{id}
$tableTagAttributes->{class} = $combinedTableAttrs->{class};
$tableTagAttributes->{id} = $combinedTableAttrs->{id}
|| undef;
$tableTagAttributes->{summary} = $combinedTableAttrs->{summary};
$tableTagAttributes->{frame} = $combinedTableAttrs->{frame};

0 comments on commit 376bfd5

Please sign in to comment.