I've been trying for months to get this fixed and wasn't able to find a way.
Here's an example: https://robloxarsenal.fandom.com/wiki/Template:SeasonPass
I've been trying for months to get this fixed and wasn't able to find a way.
Here's an example: https://robloxarsenal.fandom.com/wiki/Template:SeasonPass
Had similar issues, found out that adding a |{{!}}- at the end of every parser fixes this, there would be issues if you were to add tier X and XII but skipped XI as it would move tier XII to its own row, but based on the template I don't think this situation would happen. If it would, I don't really have a solution for that.
For example, turn this:
{{#if:{{{item29|}}}|! style="background: var(--wikilink); padding: 2px; color: black" {{!}} {{{kills29}}}}}
To this:
{{#if:{{{item29|}}}|! style="background: var(--wikilink); padding: 2px; color: black" {{!}} {{{kills29}}}|{{!}}-}}
If every single one is changed it should look like this.
Oh my god, never thought I could finally solve this issue. Thank you so much.
The problem is, that all those #if: statements are on a new line.
This produces a lot of paragraphs:
The solution above is a hack, as the MediaWiki software seems to ignore empty <tr> tags ( |- )
Now it creates this:
Solutions would be to not have each parser function on a new line.
This could be done in several ways:
{{#if:
{{{item11|}}}|!! <stuff goes here> }}{{#if:
{{{item12|}}}|!! <stuff goes here> }}{{#if:
{{{item13|}}}|!! <stuff goes here> }}...
or
{{#if:
{{{item12|}}}|<nowiki/>
! <stuff goes here> }}{{#if:
{{{item12|}}}|<nowiki/>
! <stuff goes here> }}{{#if:
{{{item13|}}}|<nowiki/>
! <stuff goes here> }}...
or
Use html code.
Using html ( <tr> / <td> / <th> ) instead of its wikitext variants is often the better solution when done inside parser functions, as you don't have to deal with escaping pipes or other wikitext formatting, or make sure a new cell ( ! or | ) starts on a new line.
{{#if:{{{item11|}}}|<th style="..."> (stuff) </th>}}{{#if:{{{item12|}}}|<th style="..."> (stuff) </th>}}{{#if:{{{item13|}}}|<th style="..."> (stuff) </th>}}...
Also, you should really remove all those inline styles and use a class instead of repeating the exact same lengthy styles over 100 times, and define it once (1x) in your wiki's css file.
It would remove lots of unneeded repetition and make your code much cleaner and your template much better maintainable.
Noted
What do you think?