cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
This question about Topic Markup Language and applications: Answered

How do I omit certain table cols in print view?

Answer

You can do this with CSS and the TablePlugin.

%IF{ "$ cover='print'" then="<style type='text/css' media='all'> .foswikiTableCol1 { display:none; } </style>" }%

The IfStatement checks the url parameter cover. If it is set to print (this is how the print view works at least in PatternSkin), one line of css code is injected into the topic making that column disappear in the print view. Alter the number in foswikiTableCol1 to hide other columns (couter starts with 0).

This simple version applies to all tables on the topic. With some knowledge on CSS this can be easily restricted to single tables.

Example

%TABLE{id="Foo"}%
|*Head1*|*Screen-only*|*Head2*|*Head3*|
| 1 | 2 | 3 | 4 |
| 1 | 2 | 3 | 4 |
| 1 | 2 | 3 | 4 |
| 1 | 2 | 3 | 4 |

Head1 Screen-only Head2 Head3
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4

QuestionForm edit

Subject Topic Markup Language and applications
Extension TablePlugin
Version
Status Answered
Topic revision: r1 - 08 Jun 2009, OliverKrueger - This page was cached on 23 Jun 2018 - 21:48.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy