This question about Topic Markup Language and applications: Answered

Generate complex tables in Foswiki using TML

I'm trying to include content of query within table. However, I'm not sure what I'm doing wrong:

   * Set Col1 = %TREE{web="MyWeb1/Basic" excludetopic="Web*" levelprefix="   " startlevel="1" stoplevel="2"}%
   * Set Col2 = %TREE{web="MyWeb1/Configuration" excludetopic="Web*|Chart" levelprefix="   " startlevel="1" stoplevel="2"}%
   * Set Col3 = %TREE{web="MyWeb1/Advanced" excludetopic="Web*" levelprefix="   " startlevel="1" stoplevel="1"}%
   * Set Col4 = %TREE{web="MyWeb1/Tools" excludetopic="Web*" levelprefix="   " startlevel="1" stoplevel="1"}%

%TABLE{cellborder="0" cellspacing="20" columnwidths="24%,24%,24%,24%"}%
| *---++ Basics:* | *---++ Controllers:* | *---++ Advanced:* |  *---++ Tools:* |
| %Col1% | %Col2% | %Col3% | %Col4% |

-- MateuszKDzior - 16 Oct 2015

I have a few suggestions about what will work better:
  • The Foswiki syntax for headings ("---++") only works when that is at the beginning of the line, so it won't work for table headers. Try using this instead: *<h2>Basics:</h2>* .
  • Foswiki syntax for tables is fairly easily broken by return characters and "bars" ("|") within cells. In the case where you want to put bulleted lists within cells, you'll get better results using html tabs to define your table. E.g.:
    <table><tr><td> %Col1% </td><td> %Col2% </td> <td> %Col3% </td><td> %Col4% </td> 

-- LynnwoodBrown - 28 Oct 2015
 

QuestionForm edit

Subject Topic Markup Language and applications
Extension
Version Foswiki 2.0.0
Status Answered
Related Topics
Topic revision: r2 - 28 Oct 2015, LynnwoodBrown
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