Megapolis Wiki
Advertisement

Colspan in first row of template

The template allows for 7 or 8 columns, but the first row was hardcoded to use colspan="8". I replaced "8" with "{{#expr: 7 + {{#if:{{{unlock|}}}|1|0}}}}" so that the colspan will be either 7 or 8, depending on whether |unlock=| is defined and contains a value. Jcw391 (talk) 19:18, April 10, 2013 (UTC)

Template layout bug

Wiki contracttable template bug.png
For some reason the template is expanding beyond the right border. I played around with various settings, but the problem seems to be in the way class="wikitable" and width="?px" interact. If you remove class="wikitable" the border coloring is no longer visible.
class "wikitable infobox"
table name: Contracts
Name Image Cost Coin sm.png Time Reward Coin sm.png XP Experience sm.png CoinsCoin sm.png/Minute
class "infobox"
table name: Contracts
Name Image Cost Coin sm.png Time Reward Coin sm.png XP Experience sm.png CoinsCoin sm.png/Minute
class "wikitable"
table name: Contracts
Name Image Cost Coin sm.png Time Reward Coin sm.png XP Experience sm.png CoinsCoin sm.png/Minute
However, if you use class="wikitable infobox" and you remove the width specified in each row, the problem goes away.
table name: Contracts
Name Image Cost Coin sm.png Time Reward Coin sm.png XP Experience sm.png CoinsCoin sm.png/Minute
This isn't urgent, but it's driving me nuts. Jcw391 (talk) 19:18, April 10, 2013 (UTC)
Cross posted this to the Wikia Community. Jcw391 (talk) 19:32, April 10, 2013 (UTC)
It might be something to do with the settings on your computer. I don't see anything wrong with any of the tables. I don't see whatever you took a screenshot of. What browser do you use? And what setting? (wikia/monobook) --Atarpa (talk) 19:51, April 10, 2013 (UTC)
Received answer to my community post. The first suggestion was that the problem is use of width in column formatting because width was deprecated in HTML5. They suggested we use CSS style to format width. (I've seen that the current wikipedia article recommends using CSS.) Unfortunately, the problem persists even with style
class "wikitable infobox" + style="width: (value)px;"
table name: Contracts
Name Image Cost Coin sm.png Time Reward Coin sm.png XP Experience sm.png CoinsCoin sm.png/Minute
The problem is a square area to the right of the table which is gray. The area is outside of the border. I'm trying to find a visual representation of what I'm talking about ... but that screenshot above is the right-side of the table. I use Chrome & MSIE, and the person who responded on the community forums says "no problem observed, I use Firefox" which I know you use as well. Which is why there is no problem for you. Jcw391 (talk) 21:43, April 10, 2013 (UTC)
Here we go: table box model @ mozilla.org So the problem appears to be that the right-margin is colored. Jcw391 (talk) 22:23, April 10, 2013 (UTC)
Community user suggested trying style="background-color: transparent !important;" Jcw391 (talk) 22:34, April 10, 2013 (UTC)
class "wikitable infobox" + style="width: (value)px;" + table style="background-color: transparent !important;"
table name: Contracts
Name Image Cost Coin sm.png Time Reward Coin sm.png XP Experience sm.png CoinsCoin sm.png/Minute

Actually, I use Safari predominantly. I only used firefox for the add-on. Is the issue fixed? --Atarpa (talk) 23:45, April 10, 2013 (UTC)

class "wikitable infobox" + style="width: (value)px;" + table style="background-color: transparent !important;" + top row style="width: 100%;"
table name: Contracts
Name Image Cost Coin sm.png Time Reward Coin sm.png XP Experience sm.png CoinsCoin sm.png/Minute
Good to know that Safari also does not experience the rendering issue. It turns out that the solution was provided by the most recent response to the community thread. The cause of the problem is the missing width value in the first row that spans columns. I don't recall that happening with the deprecated HTML design. I'm guessing that Firefox and Safari adhere to the rendering rules I'm familiar with and that both Chrome and MSIE use different rules. I've adjusted the template to resolve the issue. I'll leave this thread here for a week and then create an archive and move it there. As it is, it clutters this talk page and if it's resolved, there is no need for it in the active talk page. Agreed? Jcw391 (talk) 05:58, April 11, 2013 (UTC)
Yeah, that sounds like a fair plan. Congratulations on fixing it, though! --Atarpa (talk) 10:25, April 11, 2013 (UTC)