|
Cookbook /
AdvancedTableDirectivesSummary: Add Table capabilities - nested tables, zebra tables, new directives.
Version: 3.1
Prerequisites: none
Status: Working
Maintainer: GNUZoo
Downloads: AdvancedTableDirectives.phpΔ
Questions answered by this recipe
DescriptionThis recipe will adds Directives and provides abilities for nested tables and for horizontal and vertical zebra tables. A demo of the capabilities is at URL: http://gnuzoo.org/test/AdvancedTableDirectivesTwo other recipes which enhance AdvancedTableDirectives are SourceCodeHorizontalLines and SimplifiedAdvancedTableDirectives. Currently tables have 3 capabilities that table directives do not have. "<header>", "<caption>" and automatic zebra formatting (see FormattingTables) of rows and columns (there are probably others too). Table Directives cannot be nested and include only 4 directives. This recipe will adds these directives: (:caption:) - caption (:head:) - header cell (:headnr:) - header cell new row (:row:) - row (:cellc#:) - current column number (:cellr#:) - current row number (:celli#:) - auto-incrementing number - incremented when used (:celli#1:) - (:celli#2:), ... (:celli#9:)]] - seperate auto-incrementing numbers (:cellic#:) - auto-incrementing column number - incremented when used, set to 1 on new row (:cellir#:) - auto-incrementing row number - incremented when used in a new row, but not in same row A demo of the capabilities is at URL: http://gnuzoo.org/test/AdvancedTableDirectives InstallingCopy AdvancedTableDirectives.phpΔ to your cookbook directory In your config.php enter: include_once("cookbook/AdvancedTableDirectives.php");
or in your farmconfig.php enter: include_once(" $FarmD/cookbook/AdvancedTableDirectives.php");
NotesAll directives follow the same syntax: For example: (:caption color=red :)This is the caption text (:head bgcolor=lightblue :)This is header text Automatic zebra formatting (mostly used for coloring) can be applied as well. In this example the table header row will have a lightblue background and the other table rows will have alternating lightgreen and lightyellow background colors. Put into config.php:
$TableRowIndexMax = 2; $TableRowAttrFmt = "class='row\$TableRowIndex'" ; $TableCellAttrFmt = "class='col\$TableCellCount'"; Put into cascading style sheet:
table th { background-color:#99ccff; }
table tr.row1 { background-color:#ffff99 ; }
table tr.row2 { background-color:#ccffcc; }
table td { line-height: 12px; }
For vertical zebra tables there are 2 new variables - TableCellIndexMax and $TableCellIndex Put into config.php:
$TableCellIndexMax = 3; $TableRowIndexMax = 2; $TableRowAttrFmt = "class='row\$TableRowIndex'" ; $TableCellAttrFmt = "class='col\$TableCellCount colidx\$TableCellIndex'"; Put into cascading style sheet:
table td.colidx1 {background-color:#ffff99;}
table td.colidx2 {background-color:#ccffcc;}
table td.colidx3 {background-color:#FFC0CB;}
For more information about formatting tables see FormattingTables. About Merging AttributesAttributes can automatically be placed onto directives using Release NotesThis program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation http://www.fsf.org either version 2 of the License, or (at your option) any later version. Copyright 2007 by GNUZoo (guru@gnuzoo.org) Please donate to the author at url: http://gnuzoo.org/GNUZooPayPal
Fix bug where <td> and <tr> tags get crossed.
PMWiki Table Directives apply the attribute valign='top' to all table cells if they do not already specify a value fot the 'valign' attribute. This was added to AdvancedTableDirectives to be compatible with PMWiki.
Comments(:cell#:) has been deprecated but will remain in code for backward compatibility
(:row#:) has been deprecated but will remain in code for backward compatibility
(:rowend:) has been deprecated because it is automatic.
I don't know what I'm doing wrong, but I keep getting the following error: "Warning: Cannot modify header information - headers already sent by (output started
at /home/<MySite>/public_html/pmwiki-2.1.26/cookbook/AdvancedTableDirectives.php:195)
in /home/<MySite>/public_html/pmwiki-2.1.26/pmwiki.php on line 884"I have tried this with an existing wiki and a clean install (no other cookbook recipes installed). I could not duplicate this behavior. I would suggest you update to the latest
version of AdvancedTableDirectives and (if you are also using) SimplifiedAdvancedTableDirectives.
If the problem persists please contact me via guru@gnuzoo.org
Thanks, that did it! Kevin Jackson 09/19/2006 Very nice recipe, thank you! H. 26/10/2006 This recipe clashes with ZAP : I was in trouble when trying using this really nice recipe with zap forms ! Adding :
See AlsoContributors |