Template talk:C Sharp

From Mario Fan Games Galaxy Wiki
Revision as of 02:02, 21 August 2009 by Baroque (talk | contribs) (How to use tables: new section)

I tried updating it with a Link to the Hello World part of the Main C# Page. Needless to say I Phail at Templates. :( --OniLink10 02:06, 12 October 2008 (EDT)

It's now fixed. Here is how:

! - foo
- bar
- spam
- eggs

instead of

! - foo
! - bar
! - spam
! - eggs

I think "!" begins a new cell, but then don't forget to remove also the leading space or it becomes a block quote! - Hohoo 04:15, 12 October 2008 (EDT)

Thanks Hohoo! --OniLink10 11:56, 12 October 2008 (EDT)

How to use tables

"!" does not begin a table cell. "!" begins a table header. This is a vital difference.

  • {| begins a table. You can also add a class or style declaration, or any other HTML attribute.
  • |- begins a table row. You can also add a class or style declaration. Most other attributes are ineffective.
  • | begins a table cell. If you add class, styles and attributes, you must place another | before adding text.
  • ! begins a table header. You need a | if you use a class, style or attribute.
  • |} ends a template.

So if you were to use this code:

{| class='' style='border: 1px solid #000; margin: auto; width: 80%;'
|-
! class='' colspan='100' | My Table
|-
| class='' | Cell 1
| class='' | Cell 2
| class='' | Cell 3
| class='' | Cell 4
|-
| class='' | Cell 5
| class='' | Cell 6
| class='' | Cell 7
| class='' | Cell 8
|}

You would get:

My Table
Cell 1 Cell 2 Cell 3 Cell 4
Cell 5 Cell 6 Cell 7 Cell 8

Most notably, you may notice that headers are type-centered and boldface by default, while cells are aligned left and not bold. They also behave differently in the view of most HTML parsers, particularly ones that speak for the blind.

It's good practice to be careful with this difference.