Community Central
Community Central
Forums: Index Support Requests Infobox Issues with gaps and
Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Archive
Note: This topic has been unedited for 4567 days. It is considered archived - the discussion is over. Information in this thread may be out of date. Do not add to unless it really needs a response.


Hello! I feel like this is such an amateur issue, but I've been having problems with fixing up the infoboxes on my wiki. I was trying to make an infobox for images so I could start categorising and licensing pictures now that they're still in the hundreds, but the sizes of the infobox are not working for me, and it seems like the #if values are acting up as well.

On one file, the information that isn't filled out doesn't show, like it should, but there is a gap between the first and second line. On another, the unfilled values still show up despite me using the same template on both files.

This is the infobox in question, which also refuses, for some reason, to make the left-hand side of the values (the ones titling the values like "Description", "Episode", etc.) smaller than the right-hand side for additional space.

I wouldn't want to change anything colour-wise with the template since it's the same colour scheme I use for character infoboxes, but I've been trying to fix the infobox for two days and I can't figure out what I'm doing wrong.

Thank you in advance!

Steel (talk) 11:52, October 15, 2011 (UTC)

The gap between filled out lines appears because the template loads each row regardless if the content of that row will be styled with "display:none" or not. You should include the whole row into the #if: parser function if you want to fix it.
The second issue was caused by the fact that some template parameters weren't named properly. I took the liberty of fixing that.
Not sure what you mean with the third issue, but both the left and right table cells have the same font-size which is 8pt. The left-side cells are bold because the headers are in triple single-quotes: '''EXAMPLE''' = EXAMPLE.
Sovq 12:24, October 15, 2011 (UTC)
Ah yes, I noticed the edit for my second issue and felt silly that I'd let something so obvious slip past me. Thank you very much for that!
As for the first issue, I'm not sure how to include the entire row into the #if: parser function. How would I be able to do that, if you know?
And for the third, I'm sorry I was unclear. I would like to keep them the same font-size and the left-side cells bold. My issue is the width of the left-hand cells themselves, which seem to extend far more than what is needed. That then leaves a large gap between the left- and right-hand cells, space that could be used more effectively for the right-hand side.
I hope I'm clearer in my description now. Thank you again for helping me out!
Steel (talk) 12:38, October 15, 2011 (UTC)
I imagine replacing:
|-
| valign="top" style="{{#if:{{{episode|}}}| |display: none;}}width:100px;font-size:8pt" | '''Episode'''
| valign="top" style="{{#if:{{{episode|}}}| |display: none;}}width:500px;font-size:8pt" class="infoboxcell" | {{{episode|}}}
with
{{#if:{{{episode|}}}|
{{!}}-
{{!}}valign="top" style="width:100px;font-size:8pt"{{!}}'''Episode'''
{{!}}valign="top" style="width:500px;font-size:8pt" class="infoboxcell"{{!}}{{{episode|}}}}}
and accordingly for other table rows would solve the first issue.
Now I see what you meant with the third issue. It's caused by the width:40% and width:60% styles added to the "disclaimer" section of the template. Removing these rules should do the job. Also, you only need to add one width:XX rule to any cell in a column to make the column that wide - I'd recommend doing so to keep the code clean. Sovq 16:53, October 15, 2011 (UTC)
Oh, I see. I can't believe I missed that again! Thank you for pointing it out! Now I fixed the values and am happy with the width. But oddly, even though I cleaned up the code and added the new one you gave me, the gap between the unfilled cells and the rest is even bigger than before.
I'm probably overlooking something again, but would you mind taking another look? Thank you once again!
Steel (talk) 17:23, October 15, 2011 (UTC)


1- There are several ways to make a part of the content of a wiki not show. For your case the if that you are using is the proper thing but using display: none; is a sloppy way to do it.
The best way to do it is to use proper html and put the whole row () and all the cells in that row, inside the if.
3- All those rows have a width of 100px for the first column and 500px for the second column. And that is defined in every row.
Then at the last row, the one with the disclaimer, you make the left column have a width of 40% and the right column have a width of 60%. That makes all the previous rows have 40% and 60% width and, in fact, ignore the 100px/500px declaration. You have to make up your mind, either it's all at 100/500 or all at 40%/60%.
Of course there are ways to make the first rows to have a width for each cell and the last row to have a different width. For that you need to make the last row a table, that way you will have a table inside the big table. But I don't think that's what you want so I won't explain it further.
Other stuff:
4- there is no float:center, just float:left and float:right.
What you want to do here is probably achievable by putting margin-left:auto; margin-right:auto; in the style declaration of the table.
5- I think the valign in each and every cell is too much, you can declare it once for the whole row by putting the valign after the |- that closes the previous row.
 Nidek   (Talk) [[Special:Contributions/Nidek| Special:Editcount/Nidek edits made ]]
Oh, thank you for all the advice! But I must admit I am a huge amateur in html coding, which is probably why I've been using such a sloppy way to write this all out. Concerning sizes, I decided to go with 100px and 500px in the end to keep everything the same size; the last row, the disclaimer, being a different size was just left over from my previous tweaking by mistake.
Ah, yes, margin-left:auto; margin-right:auto; is what I needed instead, thank you! I also fixed the valign like you suggested, but I am unsure how to go about using and including everything inside the if. Any suggestions?
Thank you once again!
Steel (talk) 18:09, October 15, 2011 (UTC)
About the gaps again; I pointed you in the wrong direction with the above code, sorry, I fixed the template to proper syntax so the problem should disappear. About using HTML instead of wiki-markup for tables - both methods have their pros and cons. I prefer wiki-markup, but you'll be fine using either. Sovq 20:24, October 15, 2011 (UTC)
Oh, that's all right; thank you for helping me again regardless! I wouldn't know the pros and cons of either. I simply went with what was easier to code for me, at least in the beginning -- I got the character infoboxes to work for me a while back, but these infoboxes simply eluded me this time around.
I believe everything is in working order now. Thank you very much to the both of you!
Steel (talk) 20:29, October 15, 2011 (UTC)