Forum:Help With Infobox

ShoutWiki — express yourself and be heard!
Jump to navigation Jump to search

Forums: Index Community help


I'm trying to create a character infobox at my wiki, following the directions from this site and a few others. Somehow, I messed up.

This is the result: https://s17.postimg.org/wcsiwqysf/Screenshot_2016_09_27_13_46_34.png

Here is my code: pastebin.com/bHh5zrLR

Thanks for your time. :D

Melaniipon (talk) 17:55, 27 September 2016 (UTC)

Stack the tables instead of nesting them. You have
{|
| ...
|-
|
{|
| ...
|-
|
{|
| ...
|-
|
{|
| ...
|}
|}
|}
|}
Instead do
{|
| ...
|-
|
{|
| ...
|}
|-
|
{|
| ...
|}
|-
|
{|
| ...
|}
|}
Also, there's no such tag as </br>. It's <br> or <br/>. --Saftzie (talk) 18:53, 27 September 2016 (UTC)
This is going to sound "dumb" as it were, but due to all the stuff in the box's code, I got lost at what you were trying to tell me. So I ended up with this -
{| align="right" style="background:#dd3333; border: 2px solid #333333; width:280px;"
| style="text-align: center;" |
 <p style="font-size: larger;">'''{{{name|{{PAGENAME}}}}}'''</p>
 <div style="background-color: #fff; margin: 0 25px;">[[File:{{{image}}}|250px]]</div>
|-
| align="center" style="background:#333333; color:#FFFFFF;"| '''Basic Profile'''
{| style="margin: 0 auto; text-align: left;"
{{#if:{{{fullname|}}}|
{{!}} style="text-align: right; width: 80px;" {{!}} Full Name:
{{!}} {{{fullname}}} }}
{{#if:{{{othernames|}}}|}
{{!}}-
{{!}} style="text-align: right;" {{!}} Other Names:
{{!}} {{{othernames}}} }}
{{#if:{{{age|}}}|}
Is there way you can give me an example that's not barebones (with my text) so I can understand the difference? Thank. Melaniipon (talk) 20:06, 27 September 2016 (UTC)
{| align="right" style="background:#dd3333; border: 2px solid #333333; width:280px;"
| style="text-align: center;" |
 <p style="font-size: larger;">'''{{{name|{{PAGENAME}}}}}'''</p>
 <div style="background-color: #fff; margin: 0 25px;">[[File:{{{image}}}|250px]]</div>
|-
| align="center" style="background:#333333; color:#FFFFFF;"| '''Basic Profile'''
{| style="margin: 0 auto; text-align: left;"
{{#if:{{{fullname|}}}|
{{!}} style="text-align: right; width: 80px;" {{!}} Full Name:
{{!}} {{{fullname}}} }}
{{#if:{{{othernames|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Other Names:
{{!}} {{{othernames}}} }}
{{#if:{{{age|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Age:
{{!}} {{{age}}} }}
{{#if:{{{gender|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Gender:
{{!}} {{{gender}}} }}
{{#if:{{{weapon|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Weapon:
{{!}} {{{weapon}}} }}
{{#if:{{{occupation|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Occupation:
{{!}} {{{occupation}}} }}
{{#if:{{{birthplace|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Birthplace:
{{!}} {{{birthplace}}} }}
{{#if:{{{status|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Status:
{{!}} {{{status}}} }}
|-
| align="center" style="background:#333333; color:#FFFFFF;"| '''Physical Description'''
{| style="margin: 0 auto; text-align: left;"
{{#if:{{{race|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Race:
{{!}} {{{race}}} }}
{{#if:{{{build|}}}|
{{!}} style="text-align: right; width: 80px;" {{!}} Build:
{{!}} {{{build}}} }}
{{#if:{{{height|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Height:
{{!}} {{{height}}} }}
{{#if:{{{skincolor|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Skin Color:
{{!}} {{{skincolor}}} }}
{{#if:{{{haircolor|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Hair Color:
{{!}} {{{haircolor}}} }}
{{#if:{{{eyecolor|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Eye Color:
{{!}} {{{eyecolor}}} }}
|-
| align="center" style="background:#333333; color:#FFFFFF;"| '''Relationships'''
{| style="margin: 0 auto; text-align: left;"
{{#if:{{{relatives|}}}|
{{!}} style="text-align: right; width: 80px;" {{!}} Family:
{{!}} {{{family}}} }}
{{#if:{{{romantic|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Romantic:
{{!}} {{{romantic}}} }}
{{#if:{{{friends|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Friends:
{{!}} {{{friends}}} }}
|}
|}
|}
|}
becomes
{| align="right" style="background:#dd3333; border: 2px solid #333333; width:280px;"
| style="text-align: center;" |
 <p style="font-size: larger;">'''{{{name|{{PAGENAME}}}}}'''</p>
 <div style="background-color: #fff; margin: 0 25px;">[[File:{{{image}}}|250px]]</div>
|-
| align="center" style="background:#333333; color:#FFFFFF;"| '''Basic Profile'''
{| style="margin: 0 auto; text-align: left;"
{{#if:{{{fullname|}}}|
{{!}} style="text-align: right; width: 80px;" {{!}} Full Name:
{{!}} {{{fullname}}} }}
{{#if:{{{othernames|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Other Names:
{{!}} {{{othernames}}} }}
{{#if:{{{age|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Age:
{{!}} {{{age}}} }}
{{#if:{{{gender|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Gender:
{{!}} {{{gender}}} }}
{{#if:{{{weapon|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Weapon:
{{!}} {{{weapon}}} }}
{{#if:{{{occupation|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Occupation:
{{!}} {{{occupation}}} }}
{{#if:{{{birthplace|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Birthplace:
{{!}} {{{birthplace}}} }}
{{#if:{{{status|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Status:
{{!}} {{{status}}} }}
|}
|-
| align="center" style="background:#333333; color:#FFFFFF;"| '''Physical Description'''
{| style="margin: 0 auto; text-align: left;"
{{#if:{{{race|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Race:
{{!}} {{{race}}} }}
{{#if:{{{build|}}}|
{{!}} style="text-align: right; width: 80px;" {{!}} Build:
{{!}} {{{build}}} }}
{{#if:{{{height|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Height:
{{!}} {{{height}}} }}
{{#if:{{{skincolor|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Skin Color:
{{!}} {{{skincolor}}} }}
{{#if:{{{haircolor|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Hair Color:
{{!}} {{{haircolor}}} }}
{{#if:{{{eyecolor|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Eye Color:
{{!}} {{{eyecolor}}} }}
|}
|-
| align="center" style="background:#333333; color:#FFFFFF;"| '''Relationships'''
{| style="margin: 0 auto; text-align: left;"
{{#if:{{{relatives|}}}|
{{!}} style="text-align: right; width: 80px;" {{!}} Family:
{{!}} {{{family}}} }}
{{#if:{{{romantic|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Romantic:
{{!}} {{{romantic}}} }}
{{#if:{{{friends|}}}|
{{!}}-
{{!}} style="text-align: right;" {{!}} Friends:
{{!}} {{{friends}}} }}
|}
|}
--Saftzie (talk) 20:27, 27 September 2016 (UTC)
So I made the changes - even copying what you did, but the formatting is still a bit odd. The top section is still centered. Is there a reason why the "Physical Description" box has "build" to the left and not lined up with the rest? https://s10.postimg.org/p89nsgh2h/Stillweird.png
Again, thanks! Melaniipon (talk) 21:26, 27 September 2016 (UTC)
You don't have a row-break ({{!}}-) before build. --Saftzie (talk) 21:32, 27 September 2016 (UTC)
That fixed it, yay! Thanks! Now to find out how to make it so ONLY the infox's headers are black... (aka Basic Profile, Physical Description, etc.). Melaniipon (talk) 02:20, 28 September 2016 (UTC)