Thread:User talk:CodeCat/Dynamic Columns/Rows/reply

Showing and hiding table cells or whole rows with "if" is a bit tricky, because the table formatting code interferes with the code for the "if". Both use |, so things get a little confused. Furthermore, table formatting depends on the presence of line breaks, so if you don't get those right, things also don't work.

For the first problem, the solution is to use the template instead of | whenever you want to use a | for a table formatting tag, but inside some other kind of conditional code like "if" or "switch". This makes the code look even harder to understand but at least it works.

For the second problem you have to keep some things in mind when it comes to tables. All the table-specific formatting tags, like and | (new cell) and |- (new row), must be placed at the beginning of a line. They can be placed inside "if", but then that "if" must be placed on the beginning of the line, so that when it is evaluated and replaced with the result text, the table tags will end up on the beginning of the line instead of the "if".

I hope this helps.