Tags:
create new tag
view all tags

SID-01972: Using variables in a table

Status: Answered Answered TWiki version: 5.1.1 Perl version:
Category: CategoryRendering Server OS: Last update: 11 years ago

I want to display variables within the cells of a table. This is easy to do in the editor, raw or WYSIWYG. But the expanded content gets displayed outside of the table. How do I force the table to re-size appropriately?

-- TWiki Guest - 2014-09-18

Discussion and Answer

For example:

Table of Contents Hierarchy
%TOC% %INCLUDE{"%SYSTEMWEB%.HierarchicalNavigation" section="all"}%

-- TWiki Guest - 2014-09-18

It depends on the variable if it is possible to embed it in a TWiki table or not. If the variable has newlines when expanded it will break a TWiki table because TWiki variables are expanded before the TWiki rendering (headings, bullets, tables, etc), and a TWiki table row cannot span multiple lines. That is, as long as the variable does not return a newline it will work in TWiki tables.

You can tell INCLUDE to convert newlines to line breaks by using a newline="$br" parameter. This requires TWiki-6.0. Details at VarINCLUDE.

If you want to use variables that have newlines in tables you need to use HTML tables instead of TWiki tables.

-- Peter Thoeny - 2014-09-19

Thanks Peter. HTML tables work. But I now have a related problem - see SID-01973.

-- Ben Kinsella - 2014-09-19

I replied in SID-01973 on how to preserve HTML tables, e.g. prevent the WYSIWYG editor from changing HTML back to TML.

-- Peter Thoeny - 2014-09-19

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title Using variables in a table
SupportCategory CategoryRendering
TWiki version 5.1.1
Server OS

Web server

Perl version

Browser & version Chrome Version 37.0.2062.120 m
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2014-09-19 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.