How to Create an Infobox: Difference between revisions

m
no edit summary
mNo edit summary
Line 20: Line 20:
Again, if you are familiar with Wikitext or HTML programming, you should notice this coding: <em>class="infobox"</em> in the table tag .  This code tells the browser that a infobox is being created and to place it in the upper right hand corner of the article.
Again, if you are familiar with Wikitext or HTML programming, you should notice this coding: <em>class="infobox"</em> in the table tag .  This code tells the browser that a infobox is being created and to place it in the upper right hand corner of the article.
====Step Two - Add Styling to Infobox====
====Step Two - Add Styling to Infobox====
Next if we want to give the infobox some style considerations such as width, borders, padding, font size, and maybe background color:
<table style="width:99%; border:1px solid blue; ">
<tr>
<td style="width:50%; border:1px solid blue; text-align:center; font-size:16pt; ">Wikitext</td>
<td style="width:50%; border:1px solid blue; text-align:center; font-size:16pt; ">HTML</td>
</tr>
<tr>
<td style="border:1px solid blue; "><nowiki>{| class=infobox style="width:200px; text-align:left; padding:0px; font-size:8pt; border:1px solid black; border-right-width:2px; border-bottom-width:2px; background-color:white;"....|}</nowiki></td>
<td style="border:1px solid blue; "><nowiki><table class=infobox style="width:200px; text-align:left; padding:0px; font-size:8pt; border:1px solid black; border-right-width:2px; border-bottom-width:2px; background-color:white;">...</table></nowiki></td>
</tr>
</table>
Again if you know Wikitext or HTML you can see the style that is being added to the infobox.
====Step Three - Create Main Header====
<table style="width:99%; border:1px solid blue; ">
<tr>
<td style="width:50%; border:1px solid blue; text-align:center; font-size:16pt; ">Wikitext</td>
<td style="width:50%; border:1px solid blue; text-align:center; font-size:16pt; ">HTML</td>
</tr>
<tr>
<td style=><nowiki>{| class=infobox style="width:200px; text-align:left; padding:0px; font-size:8pt; border:1px solid black; border-right-width:2px; border-bottom-width:2px; background-color:white;"....|}</nowiki></td>
<td style="border:1px solid blue; "><nowiki><table class=infobox style="width:200px; text-align:left; padding:0px; font-size:8pt; border:1px solid black; border-right-width:2px; border-bottom-width:2px; background-color:white;">...</table></nowiki></td>
</tr>
<tr>
<td style="border:1px solid blue; "><nowiki>{{{!}}} colspan="2" style="text-align:center; font-size:16pt; background-color:{{{title background color}}}; " {{{!}}} '''{{{name}}}"</nowiki></td>
<td style="border:1px solid blue; "><nowiki><td colspan="2" style="text-align:center; font-size:16pt; background-color:{{{title background color}}}; ">{{{name}}}</nowiki></td>
</tr>
</table>