Jump to content

Help talk:Table/Archive 4

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by MiszaBot II (talk | contribs) at 09:59, 1 August 2011 (Archiving 2 thread(s) from Help talk:Table.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Archive 1Archive 2Archive 3Archive 4Archive 5Archive 6Archive 10

Text to be centered only in certain cell

Title Year Author and Notes
First text Second text Third text
First text Second text Third text

I want automatically the "year" cell to be centered, how can I do that? Except manually adding style="text-align: center;" to each separating sign ("|-"). Userpd (talk) 21:08, 9 July 2010 (UTC)

As far as I know, that's the only way it can be done:
Title Year Author and Notes
r1 c1 text r1 c2 text r1 c3 text
r2 c1 text r2 c2 text r2 c3 text
We'd all like column styles to be applied from the first row automatically, but there's some limitation which prevents that from working. I think I read about it in bugzilla several years ago. —EncMstr (talk) 22:17, 9 July 2010 (UTC)
«but there's some limitation which prevents that from working.» And I was wondering why can't I apply vertical align for the first row automatically. Also, why don't you use valign=top instead of style="vertical-align:top;"? Userpd (talk) 18:01, 10 July 2010 (UTC)

Display the value from one infobox in another one within the same article

{{A infobox
|par1 =
|par2 =
}}

{{B infobox
|par1 =
}}

I have two infoboxes in one article. I would like the value of the parameter "par1" from A infobox display as the parameter "par1" in B infobox. If the "par2" in A infobox is not empty, change the background color of B infobox. Is it possible to do it? --WlaKom (talk) 21:30, 10 July 2010 (UTC)

I don't think you can do that, unless you created a special template for it (which I don't think is a good idea), like {{A infobox|par1={{something}}}} {{B infobox|par1={{something}}}}. What exactly are you trying to do? Also, what does this have to do with tables? This is probably not the best page to discuss this issue. Svick (talk) 22:06, 10 July 2010 (UTC)

Footnotes

I need to insert footnotes into a table. Could anyone add a section in the text describing process. Or at least write me so I can do it.RonRodex (talk) 17:35, 25 July 2010 (UTC)

Footnotes would be added like any other text. See WP:FOOTNOTES for an overview of the process. ---— Gadget850 (Ed) talk 20:53, 25 July 2010 (UTC)

Problems with display

Resolved

I wasn't sure where to ask for help, so came here. I have a problem with the display of a centered table. There are two problems which may or may not be related. Also, I use old browsers, so others may not be seeing what I see; if not please tell me. The two problems are both displayed in the article 42 (number), in the table with the caption "In other languages".

  1. The first problem is that the table is centered, but the table caption is sort of half centered. The caption text is placed to the left of where it should be. I also see this problem in this article at Help:Table#Centering tables.
  2. The second problem is that the table insists on displaying at the end of the article, just before the Categories. This is despite the fact that the table markup is higher up than that. No matter where the markup is placed in the article, the table always displays at the end (which is not where I want it to be).

Thanks for any help you can give. (Please respond here.) HairyWombat 01:46, 7 August 2010 (UTC)

I saw that table apprearing at the bottom of the page too. And it's really weird. I don't have a clue how I fixed it, because at my first edit it went back to normal and I couldn't reproduce the bug.
The table is well centered. If your are using old browsers because your boss told you to, please slap him gently for me. If it's your own decision... well... just do something about it. ;-) Cheers, Dodoïste (talk) 08:33, 7 August 2010 (UTC)

Great, many thanks. I use the most recent browsers that my operating system can support. Upgrading to more recent browsers would require a whole new computer. HairyWombat 14:01, 7 August 2010 (UTC)

Oh, interesting case. I did not know that Firefox doesn't work with old operating systems. In this case, you can use Ubuntu (operating system). Ubuntu is free and works just fine with old computers. You'll be able to have the latest version of Ubuntu for free, and install the latest browsers. You may even find an install-party near your place and have someone do the job for you! :p Dodoïste (talk) 23:50, 7 August 2010 (UTC)

Centering a column

Is there an easier way to center all of the entries for an entire column, rather than putting align=center or {{center|text}} for every entry? Cmcnicoll (talk) 23:08, 30 April 2010 (UTC)

This is my PRECISE question. Can someone please answer? Smashman2004 (talkcontribsemail) 09:18, 12 May 2010 (UTC)
No, there is no other way. If you have a complex table, you can edit it in Excel or OpenOffice Calc and convert it to wikimarkup and retain the formatting. http://excel2wiki.net/wikipedia.php ---— Gadget850 (Ed) talk 13:14, 12 May 2010 (UTC)
Is there a way of using a template or wikitable class to make whole columns right aligned (or centred)? This is for simple tables, just with some columns left aligned and some right aligned. It is very cumbersome to have to put align=right in every cell. --Pakaraki (talk) 20:36, 17 September 2010 (UTC)

Needs update

Hi. This help page should be updated according to Wikipedia:Manual of Style (accessibility)#Data tables. Tables headers should be made using "! scope="col" |" and "! scope="row" |", instead of only "!". The scope attribute tells the browser and screen reader that everything under the column is related to the header at the top, and everything to the right of the row header is related to that header. It's a straightforward concept. Yours, Dodoïste (talk) 11:17, 28 July 2010 (UTC)

I've done part of it, but this page is long, I need help! ;-) Dodoïste (talk) 03:51, 29 July 2010 (UTC)
Why don't we add this to the wikitable class instead of updating a gazillion tables? ---— Gadget850 (Ed) talk 15:38, 2 August 2010 (UTC)
Because it's impossible. The scope attribute of the <tr> tag can contain 4 values: row, col, rowgroup and colgroup. Those are used to determine what kind of header "<tr>" is. With CSS we can only add one attribute to all headers. With CSS we could decide that "headers are all column headers" for example. But that would be wrong in at least half of the cases, and completely useless. And this attributes can't be added by a bot as well, because it can't be automated.
Providing information about the headers is important for accessibility, and for reuse of the data as well. See Creating Accessible Tables, 2) Data Tables, WebAIM techniques.
Most important parts of this help page are updated now. A few things could be improved here and there, but the priorities are done. Yours, Dodoïste (talk) 00:26, 3 August 2010 (UTC)
See MediaWiki_talk:Common.css#some wikitable ideas. ---— Gadget850 (Ed) talk 12:23, 16 August 2010 (UTC)

Repeating Headers, possible?

Would there be a way to have the header of the table appear automatically every X (lets say 20 in this case) entries? It can't be done manually with a sorted table without having the headers sorted with the rest of the entries can it? This is needed as in a table with many columns the viewer may lose track of which column is which if the headers don't show up every X amount of entries.

Lets say header every 5 entries for this table, is there any way to make it so the headers stay in place and are not sorted (or a way to automate this)?

Header 1 Header 2 Header 3
1 a a
2 b b
3 c c
4 d d
5 d d
Header 1 Header 2 Header 3
6 e e
7 e e
8 f f
9 g g
10 h h

Repeating headers in the middle of the table causes accessibility issues. See Data tables tutorial#Avoiding column headers in the middle of the table. You'd better split the tables in several smaller tables. Dodoïste (talk) 01:53, 26 September 2010 (UTC)

Sorting tables with NA values (On VPT)

Please take a look at this VPT discussion regarding tables and NA values. Thanks. Protonk (talk) 20:28, 23 September 2010 (UTC)

Thoughts

The edit interface shown in the screenshot is for the Monobook skin only, since not all users use the Monobook skin shouldn't other screenshots be added? Regards, —Ғяіᴆaз'§ĐøøмChampagne?9:37pm 11:37, 25 September 2010 (UTC)

You're right. Here is a screenshot found on commons. I believe this page is not the only one concerned. Could you add this screenshot to the related pages? Thanks. :-) Dodoïste (talk) 16:01, 25 September 2010 (UTC)
 Done Dodoïste (talk) 20:34, 25 September 2010 (UTC)
Sorry I couldn't do it, I was asleep at the time. Thanks for putting it up Dodo :) Regards, —Ғяіᴆaз'§ĐøøмChampagne?11:27am 01:27, 26 September 2010 (UTC)

Outsize screen percentages no longer work?

I've been wondering about this for a while. It used to be that when using percentages for the widths of columns, you could set the total width of the table to be wider than the screen display, ie the screen display width could be, say, 120% of the visible width. Now when I try to do this however, the table just won't display beyond the visible width. Has the code been altered so this feature no longer works? Gatoclass (talk) 11:25, 3 November 2010 (UTC)

It sounds like you have been using a browser bug. I bet it wasn't supposed to be stable and future-proof anyway. Did you update your browser? Can you provide a link to your examples, so I can test and provide a more useful answer? Dodoïste (talk) 13:16, 3 November 2010 (UTC)
Well I can't give you a working example, because the feature doesn't seem to work anymore! But if, for example, you go to the Allaire Iron Works page, and look at the table at the bottom, if you fiddle with the values in that, you will probably find that you can't make the table expand beyond the visible width no matter what you do. Gatoclass (talk) 06:34, 4 November 2010 (UTC)

Unusual sorting

Hi. The table in this question is undergoing constant change, but my question can be demonstrated by this version of the page. Click once on the sort button in the "Change in rank" column and then scroll down to look at the two "0" entries. It's not that important, but I'm curious to discover why the two "0"s aren't together? Aside from that question: I didn't add any sorting code to the entries in the column, so was quite impressed to see the negative entries sort correctly in relation to the positive entries. Cheers.  HWV258.  07:22, 4 November 2010 (UTC)

Alternating row colors?

Is it possible to have a sortable wikitable like the following, but with alternating row colors that "stay put" when a different sort order is chosen, rather than following the data associated with that row? 28bytes (talk) 05:36, 24 September 2010 (UTC)

Song Performer Peak Date Peak
"Rapper's Delight" Sugarhill Gang January 12, 1980 36
"Savannah Nights" Tom Johnston January 12, 1980 34
"Romeo's Tune" Steve Forbert February 23, 1980 11
"Yes I'm Ready" Teri DeSario March 1, 1980 2
"With You I'm Born Again" Syreeta April 19, 1980 4
"Set Me Free" Utopia April 19, 1980 27
"Only a Lonely Heart Sees" Felix Cavaliere April 19, 1980 36
"Pilot of the Airwaves" Charlie Dore May 3, 1980 13
"The Seduction" James Last Band May 24, 1980 28
"Funkytown" Lipps Inc. May 31, 1980 1
"Gee Whiz" Bernadette Peters May 31, 1980 31
"Should've Never Let You Go" Dara Sedaka May 31, 1980 19
"Cars" Gary Numan June 7, 1980 9
Yes, it is feasible - and much needed. But in order to archive that we must ask an admin to add a CSS class to MediaWiki:Common.css. Afterward, simply adding « class="alternategrey" » at the top of the table would do the trick.
We won't be adding a CSS class for every colors possible though, so I recommend you use standard grayscale instead of brown.
It uses a CSS 3 property. With Vector, it works in every browser, because JQuery also support this CSS property.
With monobook however, it works in every major browser (Firefox, Safari, Chrome, Opera and the soon-to-be-released IE9) - but not IE8. When JQuery will be implemented in every skin (which is planned), this property will work whatever the browser you use. Since this is only a layout detail, I believe it's fine to use it now anyway.
The code to add in MediaWiki:Common.css is:
table.alternategrey tr:nth-child(even) {background: #E0E0E0;}
Yours, Dodoïste (talk) 15:36, 24 September 2010 (UTC)
Thanks very much for that info. The specific change I was hoping to make was to have different background colors for each of the three large tables in List of Atari 2600 games, patterned after the differently colored tables in List of 1980s one-hit wonders in the United States.
Looking at MediaWiki:Common.css, I see ".navbox-even" and ".navbox-odd" entries, which I deduce make the navboxes display the alternate colors. Since different navboxes use differently colored striped backgrounds, I wonder if that's implemented in template code someplace, or in a different .css file? 28bytes (talk) 15:52, 24 September 2010 (UTC)
Well, if the community agree we can add a CSS class for a set of colors (I'd say about 3 to 6 colors). But we need to gather consensus on that beforehand.
Speaking of it, I don't know how it works here so I don't know how to make it happen. Should we fill a RFC or something? How will we convince an admin to make this edit?
In the Navbox case, it's in the template code. And it doesn't use the technique I suggest, it uses the same inline style as you do in your example table above. I haven't seen a live exemple of this function though, so I can't provide more details about it. Dodoïste (talk) 16:22, 24 September 2010 (UTC)
See MediaWiki talk:Common.css/Archive 12#CSS striped for .wikitable. ---— Gadget850 (Ed) talk 16:50, 24 September 2010 (UTC)


(edit conflict) See the prior proposal at
The colours would be fixed; just what colours would work best with the default header-cell colour is an open question. Jack Merridew 16:54, 24 September 2010 (UTC)
Thanks everyone. Since that discussion was archived (and presumbly not implemented?), what would be the proper venue to bring it up again? It would be great to have a (small) palette to choose from, (something like the following) to help pages with multiple tables be easier to follow. 28bytes (talk) 17:23, 24 September 2010 (UTC)
table.alternategrey   tr:nth-child(even) {background: #E9E9E9;}
table.alternategreen  tr:nth-child(even) {background: #D0F0C0;}
table.alternateblue   tr:nth-child(even) {background: #D5EDFF;}
table.alternatepink   tr:nth-child(even) {background: #FDE2EB;}
table.alternateyellow tr:nth-child(even) {background: #FFFFAA;}
I just changed slightly the proposed colors, to provide enough contrast between the background color and the light blue of external links. This way, we ensure that the vast majority of tables using this class will have enough contrast whatever their content, thus being accessible and conformed to WP:ACCESS.
Add those styles to your vector.css, and have a look at the tables at User:Dodoïste/Sandbox. How do you like it? Dodoïste (talk) 18:36, 24 September 2010 (UTC)
Hmm, I must be missing a step, I'm not seeing any colors. 28bytes (talk) 18:50, 24 September 2010 (UTC)
Would help if I switched my prefs to Vector, wouldn't it? :) I can see the colors now, they look great. 28bytes (talk) 18:55, 24 September 2010 (UTC)

I'll support a grayscale form of this proposal along the lines of the zebra-striping using some wikitable-compatible grey for the off-rows. Offering-up a set of à la carte colour-picks is inappropriate, however. Colours should have semantic meaning, which means selecting them by some means other than by colour-name. Jack Merridew 04:22, 25 September 2010 (UTC)

I agree. I just don't see the need for colors. Among other issues, they will not print well on monochrome printers. ---— Gadget850 (Ed) talk 04:40, 25 September 2010 (UTC)
I also agree. If we don't want Wikipedia to look like a Christmas tree with colors everywhere, we'd better keep the grayscale. However, if it was only me I would have kept the blue stripping too, because I love it and I believe it goes well with the Vector theme.
Also, naming this CSS class "zebra" instead of "alternategrey" will make it really easier to remember and to use.
Note this is also an accessibility improvement. Users with dyslexia will find large tables much easier to use when row colors are alternated.
So, taking into account the comments, here is the CSS class we should add:
table.zebra   tr:nth-child(odd) {background: #E9E9E9;}
Kind regards, Dodoïste (talk) 05:40, 25 September 2010 (UTC)
We already have colors. The point of my request was to fix the way the sorting works on the tables that have them. 28bytes (talk) 12:28, 25 September 2010 (UTC)
Don't worry, those can be fixed; they're all MOS vios per WP:Deviations; the colours are mere gratuitous ornamentation. Jack Merridew 05:05, 26 September 2010 (UTC)
Even if a small palette is rejected, could we at least have two? A regular (grey) and an alternate (blue) would make it much easier for readers to differentiate two adjacent tables. 28bytes (talk) 12:54, 25 September 2010 (UTC)
No; be happy if you get gray. Even then, there's the view that none of this is actually helpful:
Jack Merridew 05:05, 26 September 2010 (UTC)
Interesting study. I will say I agree with the subjects who found the striping more aesthetically pleasing. Regardless, I will indeed be happy if some form of striping is available for sortable tables, and I will be grateful for any help making that a reality. 28bytes (talk) 06:20, 26 September 2010 (UTC)

This is up for discussion at MediaWiki talk:Common.css#Zebra striping, again. Cheers, Jack Merridew 23:14, 9 November 2010 (UTC)

Thanks for posting the link, I'd been wondering about that. 28bytes (talk) 23:23, 9 November 2010 (UTC)

couldn't find help for this

Please show me how to fix this. Thanks, Espoo (talk) 19:37, 23 November 2010 (UTC)

I don't see any problem with removing the blank lines. It makes the text wrap beside the table. Is that a problem? —EncMstr (talk) 21:02, 23 November 2010 (UTC)
I assume the OP uses a narrow browser window. Since the content to the right is relatively wide, I think it would be nice if the main content had a minimum width in this case. I went looking for a template that does this, but came up empty. Try adding something like this instead of the blank lines:
<div style="margin-bottom:-18pt">{{pad|200px}}</div>
It's a massive hack, that would need to be improved before use, but I hope you can see the effect I'm after. Try resizing the browser window to see the effect. --Mepolypse (talk) 21:45, 23 November 2010 (UTC)
Very strange. When i opened the version prior to my edit just now, "Several similar" was all alone at the left of the Venn diagram, and the text below the tables started incomprehensible with "linguistic concepts are related to homonymy". But now i cannot reproduce the problem even with the old versions after i pressed Ctrl+0 in Firefox, no matter what text size i use. --Espoo (talk) 09:21, 25 November 2010 (UTC)

Interactive tables

I think one of the next thing mediawiki software needs to implement is to upgrade tables to be more interactive. When I say that I am thinking about the ability to show/hide some rows and columns, defined in some kind of profile. Take for example this list: List of countries by population. For example an interactive table would be capable to show the countries of a single continent, and hide those from other continents, when the user needs that. Also would help the user see the first 5 countries from each continent for example. When you have a conversation with someone, you might want to show just some of the data in the table, therefore you would like to be able to hide the columns 4,5 and 6, because they are not relevant in your discussion. Profiling tables would mean adding some filters (simple or sophisticated), or simply to manually define each profile. However implemented in the software, I don't think it would ask for extensive work from the programmers, also it won't load the browser with too much JavaScript, but it would be for sure a MASSIVE improvement for the way data can be presented and make use of. Thanks. —  Ark25  (talk) 01:00, 11 December 2010 (UTC)

Thanks for your thoughtful suggestion. The best places to suggest this are Village Pump Proposals area, and possibly as a feature suggestion for the developers at WP:BUG. —EncMstr (talk) 01:23, 11 December 2010 (UTC)

spacing and padding definition

It would be useful for the article to precisely define the terms cellspacing and cellpadding and clarify the difference between them. I've tried them both, but I can't figure out what the difference is, although they clearly don't do the same thing. —MiguelMunoz (talk) 22:32, 19 December 2010 (UTC)

Cell spacing is the space between adjacent cells; cell padding is extra space inside a cell. See this and click on the corresponding terms for a graphical explanation. —EncMstr (talk) 22:43, 19 December 2010 (UTC)

UGLY

This page has become unnavigable and ugly. Is there a way we could streamline this, adopt some common styles and images to use as a base, and, oh, I don't know, generally clean it up. I tried finding something for a friend and just kept getting lost in this mess over and over. Sven Manguard Wha? 04:18, 5 January 2011 (UTC)

100% agree. Tables are hard enough as it is. An overhaul is needed keeping beginners in mind. Anna Frodesiak (talk) 04:35, 5 January 2011 (UTC)
Maybe organize it as if it were for "shoppers". Show the product with the "how-to" and "what-made-it-look-that-way" underneath. Anna Frodesiak (talk) 04:37, 5 January 2011 (UTC)
Or maybe organize it by code, showing the effect, isolated from other code, so users can see exactly what each bit of code produces.
At the moment, what I find frustrating, is that the code that is responsible for an appearance is not shown. I see a bunch of code and a result. I have no idea what results in what, so I have to use trial and error to figureit out. Anna Frodesiak (talk) 04:41, 5 January 2011 (UTC)
I use tables quite a lot and have become pretty frustrated with this help page as well. I usually resort to looking at numerous articles to find an existing table that kind of looks like what I want; then I copy it to my sandbox and by trial and error methods tweek it to get the result I want - or as close as I can get it. In addition to establishing a better direct relationship with the code and the result it generates, there is a need to show how multiple codes interact with each other to give a new result. Whatever, changes are made to the page, there should be a library of examples given (I mean dozens) to pick from. While I dislike too much control, it is also necessary to have the table format policies or preferences of the Wiki world reflected in and restated with each example. Some tables in some articles so complex that editors with the potential to contribute a lot of quality content are disuaded from participating because they are overwhelmed by the complex codes - not good. Middle ground is required.Newwhist (talk) 12:31, 5 January 2011 (UTC)
Hooray for vindication. Now does anyone know an expert in Wikitables that could do the changes? Sven Manguard Wha? 19:09, 5 January 2011 (UTC)
I am. I intend to work on it in a sandbox—perhaps User:EncMstr/Help Table. Due to real life challenges, I won't be able to start for a few days, but then it should go rapidly. —EncMstr (talk) 20:45, 5 January 2011 (UTC)
If there's any way I can help, please just ask. Anna Frodesiak (talk) 23:34, 5 January 2011 (UTC)

Centering a Table

Currently, this page dictates (under Mélange) that the appropriate way to center a table is by using:

{| align="center"
|+ '''An example table'''
|- ...
! 

This, however, does not work in firefox, only in internet exploder. If you look at the wiki behind the example after the markup, it is, in fact, using margin:auto - so the markup syntax above the example is essentially lying.

Note that the other section that shows centering tables (Help:Table#Centering_tables) dictates that style="margin: 1em auto 1em auto;" should be used. The first section should definitely be corrected, and then some consistency is needed. --Alainbryden (talk) 14:56, 17 January 2011 (UTC)

Image as header: accessibility problem?

Does the use of images for headers (per Help:Table#Vertically oriented column headers create accessibility problems? For example, seems like screen-readers would not be able to recognize or interpret the "text". Should there always also be an WP:ALT for each image with the plain text contents (alt=Date/Page, and alt=VG:Project (link to Wikipedia:WikiProject Video games) or alt=Wikipedia:WikiProject Video games, for the first two columns in the sample)? DMacks (talk) 16:38, 21 January 2011 (UTC)

Switching columns

What's the easiest way to switch columns around in a table? I was wondering if there was a way to do it using Excel because I'm working on a table for a list article within my user pages and I'd like to switch a couple of columns. There already about 50 or so rows in the table and I'd like to save time and frustration from doing it manually if I could. –Dream out loud (talk) 09:16, 1 February 2011 (UTC)

You are on the right track. Highlight and copy the wiki table, then paste it into Excel. Make your changes, copy the cells and paste into http://excel2wiki.net/. Copy and paste the results. ---— Gadget850 (Ed) talk 17:36, 1 February 2011 (UTC)