Difference between revisions of "Template talk:T chart"

From Pathfinder Wiki
Line 39: Line 39:
 
Some of the coding for the template gets funky because you can't mix parser functions like <nowiki>{{#if:}}</nowiki> with vertical bars needed to separate table elements.  So anywhere we have <nowiki>{{!}}</nowiki> is a place where we cannot have a vertical bar (but need one).
 
Some of the coding for the template gets funky because you can't mix parser functions like <nowiki>{{#if:}}</nowiki> with vertical bars needed to separate table elements.  So anywhere we have <nowiki>{{!}}</nowiki> is a place where we cannot have a vertical bar (but need one).
  
 +
==Bugs==
 +
The right column ends up with an extra blank line for every unused row.  If I don't put a carriage return between between the <nowiki>{{#if:}}</nowiki> functions, that goes away, but the the {{!}}- row separators break.  I've not figured a way around that yet.
 +
 +
==Future changes==
 
Might be able to make a row show up if either Ln or Rn are present by doing something like this:
 
Might be able to make a row show up if either Ln or Rn are present by doing something like this:
  

Revision as of 01:48, 9 May 2020

Documentation

This template makes a T-chart with up to 6 rows (besides the header). The first row is mandatory, as is the left column of each row that's present.

{{T chart

|left_heading=Fruit
|right_heading=Vegetables
|L1=Banana
|R1=Squash
|L2=Apple
|R2=Radish
|L3=Orange
|R3=Carrot
|L4=Grape
|R4=Eggplant
|L5=Lime
|R5=Zucchini
|L6=Blackberry
|R6=Olive
}}

Fruit Vegetables
Banana Squash
Apple Radish
Orange Carrot
Grape Eggplant
Lime Zucchini
Blackberry Olive

Some of the coding for the template gets funky because you can't mix parser functions like {{#if:}} with vertical bars needed to separate table elements. So anywhere we have {{!}} is a place where we cannot have a vertical bar (but need one).

Bugs

The right column ends up with an extra blank line for every unused row. If I don't put a carriage return between between the {{#if:}} functions, that goes away, but the the |- row separators break. I've not figured a way around that yet.

Future changes

Might be able to make a row show up if either Ln or Rn are present by doing something like this:

{{#ifexpr: {{#len:{{{L2}}}}}|{{#len:{{{R2}}}}}|code for including the row|}}