Template talk:Prettytable
From Wikipedia, the free encyclopedia
See also Meta.on
[edit] Discussions before 2006
- Mostly unrelated to the new
[edit] talk
Thanks, this is nice! I've just added it to DES. — Matt Crypto 13:55, 1 Mar 2005 (UTC)
Nice! Are there any other such templates? For instance, the DES article has a different stlye for the infobox that would be useful, etc. If there are others, they should be gathered in one place. - Omegatron 01:03, Mar 16, 2005 (UTC)
[edit] Usage instructions
- Usage instructions by Frederik, moved from the Village Pump. —Ævar Arnfjörð Bjarmason 22:46, 2005 Mar 5 (UTC)
Memorize the templates {{prettytable}} and {{highlight1-3}}, and you won't have to memorize HTML attributes and color codes to make a nice-looking table ;) - Fredrik | talk 16:54, 19 Feb 2005 (UTC)
Wiki markup
{| {{subst:prettytable}} |+Prettytable example |- !Foo !Bar !Baz !Quux |- |100 |{{highlight1}}|Cake |Monster in the closet |NO! |- |Wikipedia |{{highlight2}}|^______^ |Darth Vader |{{highlight3}}|42 |- |Moo |1.618033989 |{{highlight3}}|Pay your bills |{{highlight2}}|Bach |}
What it looks like in your browser
Prettytable example Foo Bar Baz Quux 100 Cake Monster in the closet NO! Wikipedia ^______^ Darth Vader 42 Moo 1.618033989 Pay your bills Bach
[edit] Captions
This is so great. Is there a way to make captions prettier? I've added a description of this template to meta:Help:Tables#Style templates - Omegatron 17:58, Mar 21, 2005 (UTC)
Comparison without/with template:
{| |+Multiplication table |- ! × !! 1 !! 2 !! 3 |- ! 1 | 1 || 2 || 3 |- ! 2 | 2 || 4 || 6 |- ! 3 | 3 || 6 || 9 |- ! 4 | 4 || 8 || 12 |- ! 5 | 5 || 10 || 15 |}
makes
× | 1 | 2 | 3 |
---|---|---|---|
1 | 1 | 2 | 3 |
2 | 2 | 4 | 6 |
3 | 3 | 6 | 9 |
4 | 4 | 8 | 12 |
5 | 5 | 10 | 15 |
...............
{| class="wikitable" |+Multiplication table |- ! × !! 1 !! 2 !! 3 |- ! 1 | 1 || 2 || 3 |- ! 2 | 2 || 4 || 6 |- ! 3 | 3 || 6 || 9 |- ! 4 | 4 || 8 || 12 |- ! 5 | 5 || 10 || 15 |}
makes
× | 1 | 2 | 3 |
---|---|---|---|
1 | 1 | 2 | 3 |
2 | 2 | 4 | 6 |
3 | 3 | 6 | 9 |
4 | 4 | 8 | 12 |
5 | 5 | 10 | 15 |
I think this code makes the caption prettier. Not sure if it should be beneath the table or not, though. I like it beneath:
/* Prettier caption? */ .prettytable caption { caption-side: bottom; width: auto; text-align: center; font-weight: bold; margin-left: 0em; margin-right: 1em; }
So it looks like this:
× | 1 | 2 | 3 |
---|---|---|---|
1 | 1 | 2 | 3 |
2 | 2 | 4 | 6 |
3 | 3 | 6 | 9 |
4 | 4 | 8 | 12 |
5 | 5 | 10 | 15 |
More examples at User:Omegatron/Prettytable examples
[edit] move this to CSS
The function of this template is much better served if someone writes this up as a CSS class, and adds it to our stylesheets (MediaWiki:Monobook.css). Please review Wikipedia:Meta-templates considered harmful (which is a proposed guideline) for reasons why "templates within templates" are a server performance hit. Specifically, the "Alternatives" section describes that templates used to generate style should be replaced with the CSS classes. -- Netoholic @ 22:40, 2005 Mar 21 (UTC)
- Then how would it be editable? It's a format for tables, not for other templates. - Omegatron 23:30, Mar 21, 2005 (UTC)
It is editable in at MediaWiki:Monobook.css. Even a template that's used in this way is a "meta-template". In fact, this prettytable template has already found its way into other templates, just check the Special:Whatlinkshere/Template:Prettytable. Since its only purpose is to set a style, we can avoid the growing server impact by moving this to CSS. -- Netoholic @ 16:53, 2005 Mar 22 (UTC)
- Alright. So you would replace
{{prettytable}}
withclass="prettytable"
instead? And this and other style classes will be listed on an editing help or table help page somewhere? - Omegatron 17:48, Mar 22, 2005 (UTC)
That is exactly what I'd suggest. For now, MediaWiki talk:Monobook.css would be another good place but perhaps we need to start documenting these somewhere. Like Wikipedia:CSS? -- Netoholic @ 18:20, 2005 Mar 22 (UTC)
- Yes, as long as they are well-documented and visible, it sounds good to me. Why doesn't CSS have the same problems, though? - Omegatron 18:45, Mar 22, 2005 (UTC)
CSS is downloaded essentially once per session, and applied on the client-side. Templates are database objects, just like pages. There is overhead when the server has to render the page in order to serve it to you. Also, each time the template is changed, it marks all pages using it as needing to be re-built. There is also overhead in that links to the template have to be maintained and updated.
There is history to support this sort of move. The "toccolours" CSS class was the result of people doing a very similar thing as "prettytable". Moving all that extra code to a single CSS makes pages shorter by a few dozen bytes. It all helps. -- Netoholic @ 20:13, 2005 Mar 22 (UTC)
- I am playing with this in my user css. Note that we still need to include the cellspacing and cellpadding, which can't be included in the css for 100% of viewers. "In any event, IE does not yet support the border-spacing property, while Netscape 7 and Opera 7 do. So you still need to use the old HTML method for the majority of the market." - Omegatron 17:06, Mar 24, 2005 (UTC)
This works in firefox, but not IE (Omegatron):
/* Style for pretty tables (to replace Template:prettytable) */ .prettytable { margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; border-spacing: 0; padding: 0; font-size: 95%;" } .prettytable th { border: 1px #aaa solid; margin: 0; padding: 4px; } .prettytable td { border: 1px #aaa solid; margin: 0; padding: 4px; }
May I suggest you take your discussion here: MediaWiki talk:Monobook.css. Also may I strongly recommend against using the class name "prettytable". Class names should describe the function of the object, not the appearance, i.e. instead of using "red_text" you might use "alert_text". You need to work out to which types of tables you want the styling to apply - and then apply it to all tables of that sort. It is important to try and install some consistency in the styling of articles. ed g2s • talk 21:02, 16 Apr 2005 (UTC)
- We could (should?) definitely move some of this code to css, and replace that code in the template with a class="prettytable" line, but some of the code in this template does not work under IE, so that would need to remain here. The caption code above, however, does not work in a template, so a mixture of both seems to be the only solution at this point.
- Ed, what kind of name would you suggest for such a class? - Omegatron 15:21, May 18, 2005 (UTC)
The current code is
border="2" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse;"
It is correct that IE does not support 'border-spacing', but it does support 'border-collapse: collapse', which always implies "border-spacing: 0", which is the same as "cellspacing=0". It also supports 'padding' for 'td' and 'th' correctly, which is what "cellpadding=4" does. Even that contradicting "border=2" and "border: 1px #aaa solid" is handled the same as in Firefox. Therefore I really cannot see any reason not to move this into the stylesheets (there are more skins than Monobook). Even if in IE some spacing was one or two pixels off or the border color a little darker—it did not matter! Server resources are much more valuable than such a minor glitch. So my proposal is:
table.pretty { margin: 1em 1em 1em 0; border-collapse: collapse; background: #f9f9f9; color: #000; /* font-size: 95%;*/ } table.pretty th, table.pretty td { border: 1px #aaa solid; padding: 4px; }
And while we are at it, add something like this, that IE really does not support:
table.pretty th[scope="col"], /* column header */ table.pretty>tbody>tr:first-child>th, table.pretty th[scope="row"], /* row header */ table.pretty>tbody>tr>th:first-child { background-color: #F00; } table.pretty th[scope="row"], /* row header */ table.pretty>tbody>tr>th:first-child { text-align: left; } table.pretty>tbody>tr:hover>td, table.pretty>tbody>tr>td:hover {/* or '*' instead of 'td' */ background-color: #8A5 }
Note that I do not like all the style choices made in this template, especially not the reduced font size. The actual color codes should be skin dependent. Furthermore I doubt that a class is at all required, because we could just make all tables look nice instead (I already did in my stylesheet). Christoph Päper 11:47, 23 Jun 2005 (UTC)
- Excellent. Have you tried this code in your user css and then loaded it in IE? I agree that the prettiness of tables should be formatted universally, but that is something you would need a lot of consensus to do. This way editors can pick and choose. You should bring it up somewhere people will notice. - Omegatron 13:49, Jun 23, 2005 (UTC)
- I am using (something like) the second part in my user CSS (Standard skin, not Monobook), but the first part, that I just corrected a bit, works fine in test pages. (It is not that complex anyhow.) I have not tested it interfering with Monobook etc, but have taken the issue to MediaWiki talk:Monobook.css, where there should be people who try (and maybe implement) it. Christoph Päper 15:46, 23 Jun 2005 (UTC)
[edit] Movement to CSS
Please note that a class "prettytable" has recently been added to MediaWiki:Common.css. Once that class name (or a substitute) has been agreed upon and is stable, this template should be changed to
class="prettytable"
and marked for deletion after a transitional period. Christoph Päper 12:01, 21 July 2005 (UTC)
- Excellent. ed g2s didn't like the name "prettytable", though, and said it should have a more functional name. It also seems that some people would want to change all tables to look better. I think that makes a lot of sense. Maybe we should think about these two things first?
- I agree about the font size, too. #See also has three others that should be used in the css, as well. I think we should leave font size out and let them add it by hand if they really want to. - Omegatron 11:45, July 22, 2005 (UTC)
-
- Please see my suggestions on MediaWiki talk:Common.css#Proposal for CSS for tables. -Fred Bradstadt 16:15, August 20, 2005 (UTC)
There are substantial differences in appearance and functionality between the "prettytable" as a class or as a template. Have look at:
A | B | C |
---|---|---|
a | bb | ccc |
aaa | bb | c |
A | B | C |
---|---|---|
a | bb | ccc |
aaa | bb | c |
- the template has margins in every cell, the class around the whole table.
- the template has the header centered and bolded, the class has it colored as well. When colors are also used in cells, a design clash may result.
- the template has lighter inner borders and a heavier outer border compared to the cell itself; the class has all borders equal.
- the template allows override on alignment (centering) a cell, the class does not.
There may be more. So far, the class is not ready to replace the template. −Woodstone 21:17:52, 2005-08-22 (UTC)
- There are far less differences with the currently discussed replacement code, see MediaWiki Talk:Common.css. It hasn’t yet been decided whether it should be a class or all tables should be changed instead. The current class was added by someone who wasn’t aware of my proposal (I think he said so in MediaWiki Talk:Monobook.css, but I’m too lazy to check). Christoph Päper 21:34, 22 August 2005 (UTC)
Further to the remarks below on font size, I now had a look at the stylesheet currently defined at MediaWiki Talk:Common.css. It seems to work pretty (pun intended) well. Big advantage is that, unlike template solutions, it can be fine tuned by a style statement in the table itself, for example:
<table class="prettytable" style="text-align: center; font-size: 95%">
This way quite a few similar templates can be cleaned out. I wonder what the progress is of moving the proposed style into production. What about naming the class "wikitable"? −Woodstone 20:01:40, 2005-09-08 (UTC)
[edit] Should these look the same?
Should the class and template look the same now or are people trying to make the class better than the template?
Prettytable template | template | template |
---|---|---|
100 | Cake | Monster in the closet |
Wikipedia | ^______^ | Darth Vader |
Moo | 1.618033989 | Pay your bills |
Prettytable class | class | class |
---|---|---|
100 | Cake | Monster in the closet |
Wikipedia | ^______^ | Darth Vader |
Moo | 1.618033989 | Pay your bills |
Wikitable class | class | class |
---|---|---|
100 | Cake | Monster in the closet |
Wikipedia | ^______^ | Darth Vader |
Moo | 1.618033989 | Pay your bills |
They look roughly similar in Firefox, but in IE the headers are orange. — Omegatron 00:09, September 9, 2005 (UTC)
- This could be because my browser hadn't updated its cache for this change. I'll check again when I get home. — Omegatron 16:01, September 9, 2005 (UTC)
To me they all look quite different (in IE6):
- inner borders compared to background are lighter in the template, darker in the class, absent in wikitable
- wikitable has no outer border
- the prettytable class has a left margin, the others do not
- the template has more padding than both classes
- the background is lighter in the wikitable class than both others
I personally like the original prettytable template best (perhaps with slightly less top/bottom padding). The darker header line in the prettytable class looks good however. −Woodstone 21:24:43, 2005-09-09 (UTC)
-
- I like the colors in the class better, especially the headers.
- I don't know what I think of the indent, but that's not a big deal. I'd have to see it in an article that uses lots of tables.
- The class has no padding in my browser. Ideally the padding would be in between what is currently displayed for the class and template. — Omegatron 21:52, September 9, 2005 (UTC)
[edit] TfD'd
This template was listed for deletion on Templates for Deletion. The decision was to keep this template. Please see Wikipedia:Templates for deletion/Log/Not deleted/April 2005 for more information.
[edit] Variants and css
There are four variants of this template that need to be taken into consideration when converting to css:
Prettytable | Prettytable | Prettytable | Prettytable |
---|---|---|---|
100 | Cake | Monster in the closet | NO! |
Wikipedia | ^______^ | Darth Vader | 42 |
Moo | 1.618033989 | Pay your bills | Bach |
Prettytable95 | Prettytable95 | Prettytable95 | Prettytable95 |
---|---|---|---|
100 | Cake | Monster in the closet | NO! |
Wikipedia | ^______^ | Darth Vader | 42 |
Moo | 1.618033989 | Pay your bills | Bach |
Prettytable100 | Prettytable100 | Prettytable100 | Prettytable100 |
---|---|---|---|
100 | Cake | Monster in the closet | NO! |
Wikipedia | ^______^ | Darth Vader | 42 |
Moo | 1.618033989 | Pay your bills | Bach |
PrettytableN | PrettytableN | PrettytableN | PrettytableN |
---|---|---|---|
100 | Cake | Monster in the closet | NO! |
Wikipedia | ^______^ | Darth Vader | 42 |
Moo | 1.618033989 | Pay your bills | Bach |
Looks like someone just tried to get around the reversion of the font size by creating a new template with a different font size. :-) I think the four should all be converted into the same CSS with no font size or alignment included, and let those be settable individually per table. - Omegatron 14:26, July 27, 2005 (UTC)
[edit] Template:Prettytablewidth
I've just created Template:Prettytablewidth, which allows for the width to be specified in the CSS. I'm not sure how better to handle it, without making Template:Prettytable be {{subst:prettytablewidth|auto}}, which can't be good for server load. I'm open to suggestions (if you put them here, add a note on my talk page, so I know to come look, please). — OwenBlacker 18:45, July 30, 2005 (UTC)
[edit] Template:Prettytable100center
Some time ago I have created a copy of Prettytable100 called Prettytable100center, with as only difference that it centers text in the cells. It is less work to left-align the row headers than to center all other cells.
[edit] Confusing background templates
The names used for the cell background colors are quite unclear. I've moved the "highlight" templates as so:
- {{highlight1}} → {{bgcolor-blue}}
- {{highlight2}} → {{bgcolor-gold}}
- {{highlight3}} → {{bgcolor-red}}
- That was not the smartest thing to do. Highlighting should be independent of actual colors used. That's the whole point, otherwise you could jsut use the HTML attribute with color names, which has less imapct on the servers. Actually the highlighting should be done with class names, just like pretty tables. Christoph Päper 20:09, 22 August 2005 (UTC)
I've added a few more along the same lines; the currently available templates are:
{{bgcolor-red}} | {{bgcolor-green}} | {{bgcolor-blue}} |
{{bgcolor-gold}} | ||
{{bgcolor-cyan}} | {{bgcolor-magenta}} | {{bgcolor-yellow}} |
‣ᓛᖁᑐ 11:06, 22 August 2005 (UTC)
Note: yes, weird, one cannot add more style elements; the new one does not add to, but replaces the whole style. −Woodstone 12:24:22, 2005-08-22 (UTC)
- But you can add any number of classes to one class attribute, and their aggregate CSS will cascade. This is why something like
class="wikitable wt_left-headers wt_shade-even-rows" style="text-align:right;"
- is much more powerful than
{{prettytable}}
- could ever be, even though the basic version would be just as easy to use. —Michael Z. 2005-10-18 22:45 Z
[edit] See also
- Template:Prettytable
- Template:Prettytable-center
- Template:Prettytable95
- Template:Prettytable100
- Template:Prettytable100center
- Template:PrettytableN
- Template:Prettytablewidth
- Template:Prettyinfobox
- Template:F1 race table
[edit] Font size
Regarding the addition of 95% font size to the template:
See m:Template talk:Prettytable#font size for an anon who thinks this is a bad idea.
Formatting issues such as font size, blank space and color are issues for the Wikipedia site-wide style sheet and should not be dealt with in articles except in special cases. If you absolutely must specify a font size, use a relative size i.e. "font-size:80%"; not an absolute size i.e. "font-size:4pt". - Wikipedia:Manual of Style#Formatting issues -
I don't see why a tiny change in size would be important anyway. - Omegatron 20:17, Jun 21, 2005 (UTC)
- I agree that the font-size should not be in the template. The advantage (if any) does not compensate those that suffer the disadvantages. Any reduction in font size makes things worse for those without good vision. Bobblewik 16:41, 26 July 2005 (UTC)
Note that I do not like all the style choices made in this template, especially not the reduced font size. The actual color codes should be skin dependent. Furthermore I doubt that a class is at all required, because we could just make all tables look nice instead (I already did in my stylesheet). Christoph Päper 11:47, 23 Jun 2005 (UTC)
- I agree about the font size, too. #See also has three others that should be used in the css, as well. I think we should leave font size out and let them add it by hand if they really want to. - Omegatron 11:45, July 22, 2005 (UTC)
-
- I agree that the font size should be specified with css and not in templates. Neither should color, margin, padding etc. Please take a look at MediaWiki talk:Common.css#Proposal for CSS for tables and participate in the discussion there as well. - Fred Bradstadt 12:54, September 7, 2005 (UTC)
- 13:40, 10 January 2005 Schneelocke: font size 95% (Copied template from http://doom.wikicities.com)
- 11:30, 17 June 2005 Crissov: font size removed
- 22:54, 18 June 2005 68.72.119.51: font size 95%
- 16:22, 21 June 2005 Omegatron: font size removed
- 19:36, 21 June 2005 68.23.97.244: font size 95%
- 23:31, 21 June 2005 68.23.97.244: font size removed
- 05:33, 22 July 2005 Cantus: font size 95%
- 10:28, 27 July 2005 Bobblewik: font size removed
- 07:04, 1 August 2005 Neutrality: font size 95%
- 05:05, 6 September 2005 AxSkov: font size removed
- 11:01, 7 September 2005 Sjorford: font size 95%
- font size removed by:
- AxSkov
- Bobblewik
- Crissov
- Omegatron
- Anon (68.23.97.244)
- statements on talk page opposing font size:
- Bobblewik
- Crissov
- Omegatron
- font size added by:
- Cantus
- Neutrality
- Schneelocke
- Sjorford
- Anon (68.23.97.244)
- Anon (68.72.119.51)
- statements on talk page supporting font size:
- None
-
- If we can all agree on leaving the font size out, there is no need anymore for the 100% variants
- Template:Prettytable95
- Template:Prettytable100
- Template:Prettytable100center
- If we can all agree on leaving the font size out, there is no need anymore for the 100% variants
-
- and perhaps we can elimiate the dreadful inconstent naming (with dash) of
- Template:Prettytable-center
- −Woodstone 15:48:16, 2005-09-07 (UTC)
- and perhaps we can elimiate the dreadful inconstent naming (with dash) of
-
-
- Yes. But how do we do that? I was just going to replace those other templates with
- {{prettytable}} style="font-size: 95%;"
- and so on, and then we could subst them in, but that doesn't seem to work... — Omegatron 16:25, September 7, 2005 (UTC)
- Yes. But how do we do that? I was just going to replace those other templates with
-
-
- Indeed, if there are several style="..." parameters to a tag, the last one takes precedence. They are not merged! So if one is in the template, you cannot add another one anymore without undoing the template. −Woodstone 17:56:24, 2005-09-07 (UTC)
-
-
- Oh. :-( I thought the last one took precedence and overwrote the first, but only overwrote the same parameters. If we convert prettytable to a class, can you say
- class="prettytable" style="font-size: 95%;"
- for the same effect? — Omegatron 18:20, September 7, 2005 (UTC)
- Oh. :-( I thought the last one took precedence and overwrote the first, but only overwrote the same parameters. If we convert prettytable to a class, can you say
-
-
- I have not tried, but according to the specs of CSS it should work. CSS works according to specificity: the most specific definition wins. So a class acts as a background to any local definitions. That is really why it's called "cascading". −Woodstone 19:26:51, 2005-09-07 (UTC)
-
-
- Right. I assumed the first style statement wins over the site style sheet, and then the second style statement wins over the first one, but since neither has the same commands inside they don't interfere with each other. If the class and then style idea works, that is an added benefit of the css version, and will get the font size changers to support it. — Omegatron 19:40, September 7, 2005 (UTC)
-
[edit] prettytable-center2
I made Template:prettytable-center2 because Template:prettytable-center wasn't really centering.. eg.
something | something better |
is by using {{subst:Prettytable-center2}} |
this | doesn't center at all |
by using {{subst:Prettytable-center}} |
-- WB 00:55, September 13, 2005 (UTC)
The template:Prettytable-center centers the text in the cells, not the table as a whole. −Woodstone 20:23, 22 September 2005 (UTC)
[edit] Border
If someone who's good with css could re-add the border back in it would be great. Without the border I think everything looks worse, see Newbury (UK Parliament constituency) for example. -- Joolz 11:52, 15 September 2005 (UTC)
- Please see discussion at MediaWiki talk:Common.css#Replacing "prettytable" templates with a style. -Fred Bradstadt 12:46, 15 September 2005 (UTC)
[edit] Template for deletion
Put on Talk page to not disrupt article display. The request for deletion is the previously announced next step after introducing a CSS class which is capable of the same (and more) and changing the template(s) to include that class. If you are using any “prettytable” template in your pet article(s), use {{prettytable}} or substitute it manually by “class="wikitable"” and thus help accelerating the deletion process and Wikipedia servers. — Christoph Päper 11:05, 22 September 2005 (UTC)
- Would there be any way to have a bot do all the substitutions? There are quite many pages using the templates. −Woodstone 11:57, 22 September 2005 (UTC)
-
- Ask Wikipedia:Bot requests — Omegatron 13:37, 22 September 2005 (UTC)
[edit] Locking?
Since this template is used on over 5000 pages, shouldn't it be locked? Not only will vandalising it disrupt the layout of a whole host of pages, but will also be torture for our already strained servers. gkhan 23:09, 25 September 2005 (UTC)
- Probably. What's the policy? — Omegatron 03:15, 26 September 2005 (UTC)
- Wikipedia:It's ok to protect pages that will set wikimedia servers on fire if vandalised and do not require to be changed very often. More commonly seen as WP:IOTPPTWSWSOFIVADNRTBCVO or WP:COMMONSENSE :D Seriously though if you look at Wikipedia:Protected page#Visibility reasons you'll see a bunch of templates protected for that very reason. gkhan 05:01, 26 September 2005 (UTC)
-
-
- Why don't you look at Wikipedia:Don't make fun of people for trying to do things properly? :-P
- I'd protect it, but I'm not sure if we've finalized the class name or whether the class should replace the template, etc. I guess it's fine to protect it. — Omegatron 13:41, 26 September 2005 (UTC)
-
-
-
-
- I've protected it. — Omegatron 20:01, 4 October 2005 (UTC)
-
-
[edit] What happened
The format of "prettytable" seems to have dramatically and radically changed. I much prefer the old format, if this is to be the new standard, can someone furnish me the code so I can switch some tables back? I find this table is far less userfriendly in that the end of cells is not clear and it is no where near as easy to follow. - Jord 13:48, 26 September 2005 (UTC)
- It's barely different. Can you give some examples? — Omegatron 13:53, 26 September 2005 (UTC)
- This table looks completely different than it did previously. I am not sure how to show you the difference without reverting this template. - Jord 20:33, 26 September 2005 (UTC)
Showing differences below. What I see different in the "class" is:
- slightly darker header background
- stonger lines between cells
- a few millimeter smaller
Name | Riding | First elected | Shadow Cabinet roles |
---|---|---|---|
Hédard Albert | Caraquet | 2003 g.e. | Intergovernmental and International Relations, Official Languages, Culture & Sport |
Eric Allaby | Fundy Isles | 1987 g.e. | Transportation |
Name | Riding | First elected | Shadow Cabinet roles |
---|---|---|---|
Hédard Albert | Caraquet | 2003 g.e. | Intergovernmental and International Relations, Official Languages, Culture & Sport |
Eric Allaby | Fundy Isles | 1987 g.e. | Transportation |
The new form looks better to my taste. −Woodstone 20:55, 26 September 2005 (UTC)
- I agree that the new version is better. Are these the differences you saw, Jord? — Omegatron 20:59, 26 September 2005 (UTC)
- I recall there being a far larger contrast for cell seperators than either of the above show. - Jord 21:10, 26 September 2005 (UTC)
It was the version just before the template was switched to the class, to be seen at [1], containing:
border="1" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse;"
As far as colors and boundaries are concerned this has been stable quite long. −Woodstone 21:29, 26 September 2005 (UTC)
Ok, I am now looking at this from my home computer (as opposed to at work earlier) and the format looks different. Has it changed or is this simply a problem of differing settings on my work and home computers? - Jord 22:23, 26 September 2005 (UTC)
- To my knowledge the style and template have not changed between your remarks. It may depend on local settings, the browser used and the cache on the computer. You can refresh the cache by holding the shift key while clicking the reload (or refresh) button. −Woodstone 13:00, 27 September 2005 (UTC)
-
- How embarrasing. I have refreshed the cache and it looks as it did at home, all nice and pretty. Thanks very much and sorry for the trouble. - Jord 13:24, 27 September 2005 (UTC)
[edit] TfD debate
This template survived a debate on TfD. The discussion can be found here. -Splashtalk 16:06, 1 October 2005 (UTC)
[edit] Moved from lead section
Refresh your cache if the new style looks startingly different. This is Ctrl+F5 in several browsers.
Related templates:
- [talk] Template:Prettytable-center
- [talk] Template:Prettytable95
- [talk] Template:Prettytable100
- [talk] Template:Prettytable100center
- [talk] Template:Prettytablewidth
- talk Template:Prettyinfobox
- talk Template:Prettytablewidth
- talk Template:F1 race table
- talk Template:Prettytable-center2 - Centered prettytable.
Can someone document what these are for? —Michael Z. 2005-10-18 20:27 Z
[edit] convoluted
Are convoluted prettytables ok? -- Cherubino 21:28, 8 January 2006 (UTC)
1994 - 1997
|
1998 - 2001
|
2002 - 2005
|
- As you can see, it works, but the layout is not optimal. "prettytable" is meant to be left aligned on the page and has margins on top right and bottom. For the show example margins all around (and smaller) would be better (more symmetric). You could try adding style="margin: 0.5em" to the inner tables. Furthermore the template itself is deprecated and functionally replaced by a css class, so you should write: class="wikitable". −Woodstone 08:35, 9 January 2006 (UTC)
[edit] Aligning prettytable on the page
does the wikitable class automatically left-align the table? How do I use this for a right-aligned wikitable? ntennis 03:11, 31 January 2006 (UTC)
The templates are deprecated. Advised is to use the class in the first line of the table as follows
{| class="wikitable"
In the first line you can add align="right" to right align the table. Note however that the table has top right and bottom margins, whereas a proper right aligned table should have top left and bottom margins. You could correct this by writing:
{| class="wikitable" align="right" style="margin: 1em 0 1em 1em"
Note also that centering the table this way (align="center") does not work properly in Firefox. −Woodstone 08:26, 31 January 2006 (UTC)
- Thanks Woodstone! That did the trick :) ntennis 12:19, 31 January 2006 (UTC)
-
- I normally use
-
{| class="wikitable" style="float:right; margin:1em 0 1em 1em"
- but the result is the same. --Fred Bradstadt 13:08, 31 January 2006 (UTC)
By the way, I just happened to find out that using auto for the right or left or both margins works properly both in IE and Firefox (no need for the "align" or "float" property):
class="wikitable" |
class="wikitable" style="margin: 1em auto 1em auto" |
class="wikitable" style="margin: 1em 0 1em auto" |
−Woodstone 13:43, 31 January 2006 (UTC)
- Just bear in mind that when using
margin:auto
, the text doesn't float around the table - it stays above & below. Therefore, I would recommend this option for centered tables only. --Fred Bradstadt 14:56, 31 January 2006 (UTC)
[edit] Amount of cell padding
At the moment a discussion is going in MediaWiki on the ideal amount of cell padding in prettytables. If you want to participate, go here. −Woodstone 16:51, 11 February 2006 (UTC)
[edit] Can someone add
- Interlanguage link: no:Mal:Prettytable -- meco 08:02, 17 March 2006 (UTC)
- Interlanguage link: pt:Predefinição:Prettytable -- Tintazul 11:02, 6 May 2006 (UTC)
- I don't see the point of ILLs to a dummy template, typing {{prettytable}} (15) vs. class="wikitable" (17) is no good reason for the transclusion costs. Nevertheless these ILLs require {{editprotected}}, added below with usage info in the lead section.
- Just in case, if you do this use <noinclude>[[nn:whatever]]</noinclude>, maybe add also {{tdeprecated|use=class="wikitable"}} while you're at it, all not included, otherwise it would cause havoc. -- Omniplex 03:14, 30 May 2006 (UTC)
-
- Done. Martin 09:43, 31 May 2006 (UTC)
-
-
- Thanks. -- Omniplex 05:21, 15 June 2006 (UTC)
-
The template page says Please use class="wikitable" instead. - could someone please add a link to a page that explains how to use this code? Thanks. --Singkong2005 (t - c - WPID) 08:03, 18 June 2006 (UTC)
- Just do as it says: at the very place where you would write {{subst:prettytable}}, write class="wikitable". −Woodstone 08:32, 18 June 2006 (UTC)
[edit] Deprecation of tdeprecated
The format currently used for {{tdeprecated}} is out of date. Can I please get a sysop to change this:
- {{tdeprecated|use=class="wikitable"}}
To this:
- {{tdeprecated|Prettytable|new=class="wikitable"}}
Thanks in advance. ^demon[omg plz] 23:02, 28 November 2006 (UTC)
- The deprecated template template was deprecated? That's one for WP:BJAODN.
- Anyway, done. AnonEMouse (squeak) 21:37, 1 December 2006 (UTC)