Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Forum:Tables need headers

The Cloisters
Revision as of 05:51, 14 May 2012 by CzechOut (talk | contribs) (Created page with "{{Forumheader|Tech notes}} <!-- Please put your content under this line. Be sure to sign your edits with four tildes ~~~~ --> I've been noticing some errors with table creation,...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
IndexTech notes → Tables need headers
Spoilers are strongly policed here.
If this thread's title doesn't specify it's spoilery, don't bring any up.

I've been noticing some errors with table creation, especially amongst those tables relying on {{prettytable}} for formatting. So let's run down some of the basics of table-making just so that we're all on the same page. Now that we have proper, uniform formatting for tables, it's important we all know how to use it.

The basic code

Making a table in wikicode is actually pretty easy. You just have to know what all the little symbols do:

Symbol What it does
{| starts a table
|} ends a table
! declares that this row will define column header(s)
|| declares the end of a cell
| declares a new row

The symbol we need to examine is the exclamation point. It's really important that you understand the difference between using that and a pipe, or vertical lin. If you start the "title row" with a vertical line, you still get a table. But the resulting table will have no true header

For instance, I've been finding an awful lot of tables like this:

{| {{prettytable}}
| Writer || Director || Producer
|-
| Russell T Davies || Euros Lyn | Phil Collinson
|-
|}

This produces the following:

Writer Director Producer
Russell T Davies Euros Lyn Phil Collinson

Okay, that's a table, technically. But it's got no header. See how you can mouseover the first row just as easily as the second? That shouldn't be happening.

What you need to do, therefore, is to actually declare the writer/director/producer line as the table header. You do this by beginning that line with an exclamation mark, not a pipe. Here's the right way to make a table with wikicode:

{| {{prettytable}}
! Writer || Director || Producer
|-
| Russell T Davies || Euros Lyn || Phil Collinson
|-
|}

It's a tiny change. But notice the dramatic difference in the output:

Writer Director Producer
Russell T Davies Euros Lyn Phil Collinson

Notice that you can, if you wish, use multiple exclamation points:

Method A Method B
You can go horizontal
! Writer || Director || Producer
Or you can put one header per line, and start each line with an exclamation point. It's the same thing.
! Writer
!Director
!Producer


czechout<staff />    <span style="">05:51: Mon 14 May 2012 

Cookies help us deliver our services. By using our services, you agree to our use of cookies.