User:Imamadmad/Sandbox template help

Ok, so I made User:Liquoritz/Sandbox/Templates/Test and I want you to tell me if it is to your liking. Here it should be bellow (can't preview this comment to check it works, but it should):

Now this is a very basic template so I'll try and explain it to you. Here's the code as it is on that page:

Now let's see that without the styling parts which just make things look confusing:

Of course, you've made it harder on yourself by making a collapsing template, so let's see the code without that part either:

Just for the sake of demonstration, that last piece of code above looks like this:

Pretty basic, but now I can explain to you how it works. To start with, this template is based off of a table (as you may have noticed). To make a table using wikitext (basically, what you see when you try and edit a template and what you will see if you hit "Source Mode" on any other page) you first have to know how to "open" and "close" it (basically, telling the computer where the table starts and ends). To open the table, type {| and to close it, type |}.

When you're making a table, you generally want the basic table styling such as borders and background colours, otherwise it's just text positioned oddly on a page. Type class="wikitable" right after the {| on any table you are making to have the computer take the basic table styling from the wiki's CSS files (aka the place where the styling information is kept if you don't want it on the page itself).

When making a table, I usually also put width="100%" beside the class="wikitable" because I just like my tables taking up the entire width of a page.

So, now you have something that will look like a table, specifically:

Now we need to put stuff in the table!

To add a header cell to a table, put ! at the beginning of the line and write what you want the header to say beside it. If you want a second header beside the first, put !! and then the name of the next header, like this: which looks like this:

To add a row of normal data cells under the header, you first have to tell the computer that you want a new row. Do this by starting a new line and put |- on it. Then, hit return/enter again and start your data cells like you did your headers, except with pipes, so first cell starts with | and any other cells are separated with ||. Let me show you what I mean.

which looks like this:

Keep doing this for as many rows and columns as you need.

Will look like

That's basically the main things you need to know if you want to make a template based on a table. Does this make more sense now? which, just to remind you, looks like

If you want to complicate things and make the table collapse, you have to add aditional classes to the table, which currently just contains "wikitable". To have a collapsing table, replace class="wikitable" with class="mw-collapsible wikitable". To have a collapsing table which is already collapsed, replace the above with class="mw-collapsible mw-collapsed wikitable". Add this to what we had above and we get this: which is

That should be enough for the moment. Any more questions and you know where to find me!