Wikipedia:Requested templates/Numbering tables

Request
Hello

I need the equivalent of "#" (automatic numbering) for tables. Please see the tables in List of living supercentenarians. This is a list every day people die, and people are discovered. This means that the rank numbers in the first column must be updated by hand. what I need is some kind of this:

which results in

I think this kind of tables can be used in other cases, so I it is important.Japf (talk) 13:08, 13 March 2009 (UTC)


 * I've been playing with numbered lists in tables recently for a different template, and this problem is a lot more difficult than it might seem. automatic numbering of lists only works in a very restricted set of circumstances, and it's very difficult to simulate with templates (because templates have very little self-referencing capability).  I'm thinking about it, but I suspect that if a solution is possible, it will be more difficult to use than manual renumbering.  -- Ludwigs 2  17:57, 13 March 2009 (UTC)

Help:Sorting suggests using two side-by-side tables. It also says that the style can be adjusted to make them appear as a single table, but I have no idea how to do this. Any ideas? PC78 (talk) 23:59, 13 March 2009 (UTC)


 * basically, you adjust the CSS properties so that the 2 tables look like they are one table. it doesn't really help your problem.
 * it occurs to me, though, that you could create a 'fake' table with of an artful use of html lists and CSS. it would be kind of odd-looking, though.  let me see if I can make a quick mockup.  -- Ludwigs 2  02:54, 14 March 2009 (UTC)


 * Hello, thanks for you answers. I was able to make this table:

It is almost there, but the style="width:100px doesn't work here.Japf (talk) 13:35, 14 March 2009 (UTC)

'width' is not the property you want to be using here. try playing with the margins, paddings, and borders instead, like so: of course, I overdid it in this this example (not elegant code), but you get the idea. -- Ludwigs 2 15:32, 14 March 2009 (UTC)

The table looks like this:

There is only a problem where people are tied. Is there any way for a double highth row? I've already tried with colspan="2", or highth="xxpx".Japf (talk) 22:35, 14 March 2009 (UTC)
 * Well, in portuguese version it looks ok! Here the format is a little different.Japf (talk) 22:42, 14 March 2009 (UTC)

If you want to force a row to be double height, add  &amp;nbsp;  after the text. the break followed by a non-breaking space will make the browser expand the row vertically to contain the text. -- Ludwigs 2 23:10, 14 March 2009 (UTC)
 * It worked. Now there are  two other problems, maybe they are correlated. In the portuguese version the table looks almost good, but the double cells with  &amp;nbsp; are a little shorter than twice the highth of the other ones. Here in the english version all the cells in the rank column are shorter. I've been doing the changes in the table above. Japf (talk) 11:45, 15 March 2009 (UTC)


 * well, HTML and CSS have the same effects in portuguese as in English. it's possible that the Portuguese Wikipedia has different CSS definitions for a 'wikitable' (or use a different term than 'wikitable' for this kind of table).  there are a handful of basic problems here:
 * there are 59 entries for people, but less than 59 numbers (57, 55,53, and 51, at least, are missing)
 * the outer table should set the alignment to top (align="top") so that both of the inner tables start flush to the top
 * you'll probably need to make sure that an explicit width is set for the two inner tables using CSS in both the English and Portuguese versions. html will adjust layout depending on width of the browser widow, which means that sometimes the text in table cells will wrap, and sometimes it won't, which will throw off alignment.
 * -- Ludwigs 2 18:13, 15 March 2009 (UTC)

I don't understand what's happening here, but the portuguese table (see the second table in ) is perfect. The problem that I refered before, happened because I couldn't spell the word "height" well.Japf (talk) 23:28, 15 March 2009 (UTC)


 * lol - that's because the Portuguese table is a single table whereas what you're trying to do is create something that looks like a single table by using two tables. apples and oranges.  -- Ludwigs 2  23:51, 15 March 2009 (UTC)


 * Something was lost in translation. That "table" IS two tables that look like one. We were able to do it, but only in the portuguese wikipedia. There´s something different in the english version, and it was nice to know what.Japf (talk) 00:53, 18 March 2009 (UTC)


 * sorry, I was looking at the first table there (which is just one table). the second table on that link is two tables, and looks just as mucked up as this one.  -- Ludwigs 2  03:40, 18 March 2009 (UTC)

It should be a matter of servers or definitions, because I see it the way it should be. This means the trouble it's hard to solve.Japf (talk) 15:52, 18 March 2009 (UTC) I had to force the row heights to be equal. Now it's solved.

A solution
Is something like the following what you are looking for:

It is still a work in progress. I am, however, confident that I can fix the table formatting and also allow for tied rankings which require numbers to be skipped.

Table formatting essentially solved
Peet Ern (talk) 13:26, 22 March 2009 (UTC)

For example:

The template will also do:

Limitations
The only major limitation I am aware of is that it will only do a maximum of 50 entries when I am done. This however could be worked around as follows:

At the moment the pilot template will only do 10 items, but all the supporting sub templates will do up to 50. Peet Ern (talk) 02:40, 20 March 2009 (UTC)


 * Hi Peet, I'm glad you are trying to make the thing simpler. ThanksJapf (talk) 23:24, 22 March 2009 (UTC)
 * I should have this finished some time next week. In the mean time the proposed doc can be viewed at User:Pee Tern/Sandbox/Template/autonumbered list/doc if any one is interested.  Any suggestions here though please. (Note that limit increase to 50, and skipping duplicated numbers, and headings are still works in progress.) Peet Ern (talk) 07:50, 27 March 2009 (UTC)

Almost done Done
Just need to do headings now. Headings now done. 

Peet Ern (talk) 08:43, 29 March 2009 (UTC)
 * Sorry but not finished yet. Have had to have a bit of an enforced wikibreak.  Hopefully I can now get back to it. Peet Ern (talk) 09:19, 8 April 2009 (UTC)
 * Any issues before I move it into Template space? Peet Ern (talk) 13:38, 17 April 2009 (UTC)

Another solution
Use and

Ugly but very easy.

Example