Help talk:Table/Archive 5

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Archive 1 Archive 3 Archive 4 Archive 5 Archive 6 Archive 7 Archive 9

Thead, tbody and tfoot now supported?

From the article: "Thead, tbody and tfoot are supported from Mediawiki version 1.18 on." Is this true? And how do we use them? --V111P (talk) 19:54, 14 February 2012 (UTC)

Sort arrows

I apologize because this may be a stupid question. I can't seem to find the answer on the help page or the talk page archives. Why won't the sorting arrows appear at the top of the table in List of National Historic Sites of Canada in New Brunswick and related lists? Cheers, --Skeezix1000 (talk) 19:59, 3 March 2012 (UTC)

I think you've run into the bug described at Help:Sorting#Header styling, links, and markup. "Styling workaround 1" seems to work, using just background-color instead of background. -- John of Reading (talk) 22:14, 3 March 2012 (UTC)
That's it exactly. Thanks so much. --Skeezix1000 (talk) 18:18, 4 March 2012 (UTC)


How do I change the font size or the font color in a table? Also, how do I add or change the borders, whether inside or outside the table? Allen (talk) 22:44, 10 March 2012 (UTC)

The standard Wikipedia borders are added by putting class="wikitable" after the table start marker as advised at Help:Table#Classes. --Redrose64 (talk) 00:46, 11 March 2012 (UTC)

Edit toolbar

The "customize edit toolbar" is no longer available on the page linked to. AmericanLeMans (talk) 20:52, 13 April 2012 (UTC)

What is "the page linked to"? --Redrose64 (talk) 21:20, 13 April 2012 (UTC)


Adding |-class=unsortable to a row used to fix it within a sortable table. For example:

Header 1 Header 2
Entry 1 Entry B
Fixed 1 Fixed 2
Entry 2 Entry A

A year or so ago, the code used for this table would have fixed the fourth row down, so that it would have remained in that position if the other rows were sorted. This is obviously no longer the case. Any idea what's happened? Thanks, A Thousand Doors (talk | contribs) 16:31, 17 April 2012 (UTC)

The whole method for making tables sortable was altered with MediaWiki 1.18 in October 2011. Some of the undocumented kludges that had previously worked stopped working at that time. --Redrose64 (talk) 20:56, 17 April 2012 (UTC)
Ah, okay, thank you very much for the response. Do you happen to know if this will be readded into a later version of MediaWiki, or do you know of any other way to fix a row within a sortable table? A Thousand Doors (talk | contribs) 18:09, 18 April 2012 (UTC)
No, sorry, I don't make amendments to the MediaWiki software - I just observe the effects of changes. You'd probably need to raise a bugzilla ticket. --Redrose64 (talk) 20:07, 18 April 2012 (UTC)
Thanks for bringing Bugzilla to my attention. It would seem that this a problem that has been raised there before, but, as of yet, there is no solution. I'll keep my eye on it. Thanks again. A Thousand Doors (talk | contribs) 22:51, 30 April 2012 (UTC)
Yes, bugzilla:31060 is the right one. I note in particular that comment 7 from Krinkle (talk · contribs) contains text "It was an undocumented feature that might very well be a bug in the original code" which pretty much confirms my suspicion of 17 April above "Some of the undocumented kludges that had previously worked stopped working at that time". --Redrose64 (talk) 15:09, 1 May 2012 (UTC)

Section 3.16 : Tiny Tables within a text line

In Section 3.16 : Tiny Tables within a text line

I believe the wiki-code example, while working, is incorrect. It is missing several "close" commands -- </td> and </tr>.

I realize that this is "wiki-code" and that it works as presented, but it LOOKS like legitimate HTML, and therefore, to my way of thinking, should BE legitimate HTML. But since I don't edit at Wikipedia very often, I'll let others make that call.

Original version

Wikicode (table-within-table):
* <table style="background-color: #fafeff"><tr><td>This is a test table here<td><table height=11px><tr><td style="border: 1px solid black; font-size:60%">HELLO WORLD</table></td><td>followed by this text afterward.</table> This line is more text after the outer table.
  • This is a test table here
    followed by this text afterward.
    This line is more text after the outer table.

Corrected version

*<table style="background-color: #fafeff"><tr><td>This is a test table here</td><td><table height=11px><tr><td style="border: 1px solid black; font-size:60%">HELLO WORLD</td></tr></table><td>followed by this text afterward.</td></tr></table>This line is more text after the outer table.
  • This is a test table here
    followed by this text afterward.
    This line is more text after the outer table.

--William H. Magill 01:02, 18 May 2012 (UTC) — Preceding unsigned comment added by Whmagill (talkcontribs)

You are correct regarding the faulty HTML usage. However, I think the whole section should be removed because it describes a kludge. Boxed text is better implemented as <span style="border-style:solid; border-width:1px">boxed text</span> which gives boxed text, although a proper use for such ornamentation in Wikipedia escapes me. -- Michael Bednarek (talk) 14:40, 18 May 2012 (UTC)
And {{divbox}}. I think this should be removed. ---— Gadget850 (Ed) talk 15:52, 18 May 2012 (UTC)
Removed. -- Michael Bednarek (talk) 07:46, 19 May 2012 (UTC)

Scrollable tables with titles allways on top, is this possible?

Sometimes, tables are bigger then my screen. Here's an example: Comparison_of_Intel_graphics_processing_units#Intel_HD_Graphics. Is it possible to make them scrollable, so that the title is always on top and visible, even when scrolling the page down? -- (talk) 05:05, 5 June 2012 (UTC)

Right justification of a data column

Hi. If I am following the article correctly, there is no way to define justification in the header row, as one would typically do with a spreadsheet?
Each and every data row would need an explict align=right?
So seeing "align=right" 100 times in a table is correct?
Varlaam (talk) 05:14, 20 June 2012 (UTC)

That's my understanding, too. -- Michael Bednarek (talk) 05:57, 20 June 2012 (UTC)
Wow. Well there's a project for someone with time on his hands.
We do have our workaround! Thanks, Varlaam (talk) 08:00, 20 June 2012 (UTC)


I assume someone's on this, but just in case it's gone unnoticed, there appears to be a bug introduced in our table coding in the last few hours. See e.g. French braille, where there are now blue dashed-line boxes around the entries in the cells. They're still there w/o the wikitable format, on FF and IE. — kwami (talk) 21:28, 30 July 2012 (UTC)

Not a table change at all, but a change to one of the subtemplates; specifically this edit. What that did was to introduce a newline at the end of the template, so when used on a page in this manner:
{{Braille cell|b}} <br> [[b]], 2
it expands to
[[Image:Braille B2.svg|40px ]]
 <br> [[b]], 2
note that there is a newline before the space preceding the <br>: a space at the start of a line always causes the dashed border and monospace font
as I have done here.
This should now be fixed after I made this edit. The template no longer adds a newline, so
{{Braille cell|b}} <br> [[b]], 2
now expands to
[[Image:Braille B2.svg|40px ]] <br> [[b]], 2
as it did previously. --Redrose64 (talk) 22:02, 30 July 2012 (UTC)

Thanks for that. It works fine now. kwami (talk) 07:50, 31 August 2012 (UTC)

Table not expanding to fit contents

There's another problem: tables do not expand to fit their contents, as at the bottom of Cantonese Braille. I don't know if it's a bug with the braille template or the table syntax. — kwami (talk) 07:50, 31 August 2012 (UTC)

Is this right?:

0   main sequence   suppl.
⠀ (braille pattern blank)
⠁ (braille pattern dots-1)
⠃ (braille pattern dots-12)
⠉ (braille pattern dots-14)
⠙ (braille pattern dots-145)
⠑ (braille pattern dots-15)
⠋ (braille pattern dots-124)
⠛ (braille pattern dots-1245)
⠓ (braille pattern dots-125)
⠊ (braille pattern dots-24)
⠚ (braille pattern dots-245)
⠈ (braille pattern dots-4)
⠘ (braille pattern dots-45)
⠄ (braille pattern dots-3)
⠅ (braille pattern dots-13)
⠇ (braille pattern dots-123)
⠍ (braille pattern dots-134)
⠝ (braille pattern dots-1345)
⠕ (braille pattern dots-135)
⠏ (braille pattern dots-1234)
⠟ (braille pattern dots-12345)
⠗ (braille pattern dots-1235)
⠎ (braille pattern dots-234)
⠞ (braille pattern dots-2345)
⠌ (braille pattern dots-34)
⠜ (braille pattern dots-345)
⠤ (braille pattern dots-36)
⠥ (braille pattern dots-136)
⠧ (braille pattern dots-1236)
⠭ (braille pattern dots-1346)
⠽ (braille pattern dots-13456)
⠵ (braille pattern dots-1356)
⠯ (braille pattern dots-12346)
⠿ (braille pattern dots-123456)
⠷ (braille pattern dots-12356)
⠮ (braille pattern dots-2346)
⠾ (braille pattern dots-23456)
⠬ (braille pattern dots-346)
⠼ (braille pattern dots-3456)
⠠ (braille pattern dots-6)
⠡ (braille pattern dots-16)
⠣ (braille pattern dots-126)
⠩ (braille pattern dots-146)
⠹ (braille pattern dots-1456)
⠱ (braille pattern dots-156)
⠫ (braille pattern dots-1246)
⠻ (braille pattern dots-12456)
⠳ (braille pattern dots-1256)
⠪ (braille pattern dots-246)
⠺ (braille pattern dots-2456)
⠨ (braille pattern dots-46)
⠸ (braille pattern dots-456)
⠂ (braille pattern dots-2)
⠆ (braille pattern dots-23)
⠒ (braille pattern dots-25)
⠲ (braille pattern dots-256)
⠢ (braille pattern dots-26)
⠖ (braille pattern dots-235)
⠶ (braille pattern dots-2356)
⠦ (braille pattern dots-236)
⠔ (braille pattern dots-35)
⠴ (braille pattern dots-356)
⠐ (braille pattern dots-5)
⠰ (braille pattern dots-56)

I looked at the other tables and one of the differences I saw was that they used type=i and not size=60 in the wikitext. I do not know anything about Braille, and so I am just guessing. See also: Template:Braille cell. Template:Bc redirects to it. --Timeshifter (talk) 09:46, 31 August 2012 (UTC)

The problem that I see at Cantonese Braille appears to be similar to that described at Wikipedia:Village pump (technical)/Archive 102#Table cell should be pushed higher. --Redrose64 (talk) 13:16, 31 August 2012 (UTC)
Yes, images force the table to expand. But we don't always want to use images. Using text allows search, which is handy; also, text expands according to user settings, which is important for those with poor vision. (It seems ironic that an article on braille should not be accessible to the visually impaired.) Ideally, the table would expand appropriately regardless of whether the cells contained images or text. — kwami (talk) 03:01, 1 September 2012 (UTC)
I tried setting the style for each row, with style="font-size:300%;", but the table does not adjust for that either. Instead, every single cell needs its size reset; for the regular-size print, it then needs to be set again. That's an awful lot of coding for a workaround. — kwami (talk) 03:13, 1 September 2012 (UTC)

I copied the archived discussion from Wikipedia:Village pump (technical)/Archive 102#Table cell should be pushed higher.

Table cell should be pushed higher

Can someone explain why or howto: the 2nd cell is not pushed larger by the font-size. Situation is that {{braille cell/core}} sets the font-size within the cell (span the text), not in wikitable code (style between pipes).

-DePiep (talk) 10:18, 10 August 2012 (UTC)
Please? -DePiep (talk) 01:32, 11 August 2012 (UTC)
  • Look at Template:braille cell/core, for the font-size issues. A style="font-size:300%" would display 3x larger than the basic size, just as 500% would display the letter "C" as 5x larger.
  • A -- {{Braille cell/core| type=text | character=A}}
  • A -- {{Braille cell/core| type=text | character=A |size=100%}}
  • B -- {{Braille cell/core| type=text | character=B |size=300%}}
  • C -- {{Braille cell/core| type=text | character=C |size=500%}}
I guess people are unsure as to what the question is specifically. -Wikid77 (talk) 04:19, 12 August 2012 (UTC)
He wants to know why the table cell height does not auto-adjust iteself to the font height. Edokter (talk) — 09:42, 12 August 2012 (UTC)
As Edokter says. I could have been more clear then. -DePiep (talk) 12:57, 12 August 2012 (UTC)

I haven't studied the templates enough to understand it all.

Wikitable column problem

For this wikitable I'm trying to get the top row to only be one header and the bottom row to be 4 columns, but for some reason it keeps creating two columns (or two headers) for the first row. Help would be appreciated, thanks! CartoonDiablo (talk) 21:02, 3 September 2012 (UTC)

Cell that should not be here Effectiveness of psychotherapy treatment in adults[1]

(checkY-Proven,checkY-Presumed,☒N-No effect)

Disease or condition Psychoanalysis Cognitive
behavioral therapy
or couple therapy
(acute phase, with drugs)
  1. ^ ibid. see full table
Is this what you are aiming for?
Effectiveness of psychotherapy treatment in adults[1]

(checkY-Proven,checkY-Presumed,☒N-No effect)

Disease or condition Psychoanalysis Cognitive
behavioral therapy
or couple therapy
(acute phase, with drugs)
  1. ^ ibid. see full table
-- John of Reading (talk) 21:15, 3 September 2012 (UTC)
Yes, Thank you! CartoonDiablo (talk) 21:48, 3 September 2012 (UTC)

Colspan help needed

Please take a look at the Men's Skeet row in Template:2012OlympicShootingSchedule. The intention is for the Q to span the Mon 30 column and half the Tue 31 column, with the F taking up the rest of that column (just like on the RFP and Trap rows). It renders a bit differently in different browsers, but none of the ones I've tried (Chromium, Firefox, Opera) do it the intended way. I assume that this is because all the other cells in that column are empty, but I don't know what the preferred way of solving this might be. Any help appreciated. (talk) 10:39, 17 September 2012 (UTC)

As you suspect, the problem is that none of the rows have an entry in the first half of the Tue 31 column, so it collapses to zero width. If you can tolerate the extra border, one fix would be to split the Tue 31 cell into two, for any other row; for example, the Men's Double Trap immediately above could be altered from
| align="left"| [[Shooting at the 2012 Summer Olympics – Men's double trap|Men's Double Trap]] || colspan=2| || colspan=2| || colspan=2| || colspan=2| || colspan=2| || bgcolor="#D0A9F5"|Q || bgcolor="#FFDF80"|F || colspan=2| || colspan=2| || colspan=2| || colspan=2|
| align="left"| [[Shooting at the 2012 Summer Olympics – Men's double trap|Men's Double Trap]] || colspan=2| || colspan=2| || colspan=2| || || || colspan=2| || bgcolor="#D0A9F5"|Q || bgcolor="#FFDF80"|F || colspan=2| || colspan=2| || colspan=2| || colspan=2|
It doesn't have to be that row - any of the fourteen event rows which have nothing that day will do. --Redrose64 (talk) 15:22, 17 September 2012 (UTC)

Problem with Wikitable margins

I've created a right-floating table on a page I'm revamping, but for some reason the body text runs right up against the edge of the table no matter what I do. Am I doing something wrong? I've never had this problem before. – Maky « talk » 04:47, 28 September 2012 (UTC)

style=float:right; border="1"; width="450pt"style="float:right; margin:5px;"
The wikitable class already defines border:1, so that is redundant, and you don't need the width here. I used margin to set the spacing around all the outside of the table— you can tweak it as desired. ---— Gadget850 (Ed) talk 09:19, 28 September 2012 (UTC)
Excellent. Thanks for the fix and sorry for the dumb question. – Maky « talk » 11:32, 28 September 2012 (UTC)
You are welcome. It's not dumb to ask for help when you need it. ---— Gadget850 (Ed) talk 12:11, 28 September 2012 (UTC)

(unindent). Here is a trick I learned at Wikia where their pages are so narrow that every pixel counts when wrapping text around floating tables. It is possible to specify only a left or right margin.

  • style="float:right; margin-left:5px;"

As for border="1" it is part of HTML 5, and not CSS. One does not use it inside CSS code. No "style=" in front of it. Just put it in separately.

  • border="1" style="float:right; margin-left:5px;"

border="1" is allowed in HTML 5 so that tables can be understood anywhere they are placed even without their site CSS. Kind of like how paragraph <p> and break tags <br> work when text is passed on in email and blogs, and are not dependent on external CSS. Just as text can be passed on in email, blogs, etc, so can tables be passed on more comprehensibly in email, blogs, etc.. Otherwise many tables would be incomprehensible when passed on without borders. The numbers and alignment in data cells in many tables would be too confusing and mixed up without borders.

There are various HTML 5 pages that explain all this in detail, and other reasons for border="1".

{| class="wikitable" border="1"
! header 1
! header 2
! header 3
| row 1, cell 1
| row 1, cell 2
| row 1, cell 3
| row 2, cell 1
| row 2, cell 2
| row 2, cell 3

The above wikitext is produced when I click the table button in my edit window. The table button is in the "advanced" dropdown menu bar. --Timeshifter (talk) 04:23, 29 September 2012 (UTC)

When I use the table button, I just get class="wikitable". I use Vector with the enhanced toolbar. The Vector stylesheet includes:
table.mw_metadata {
margin: 1em 0;
border: 1px #aaa solid;
background: white;
border-collapse: collapse;
So, you can specify a border in either HTML,[1] or CSS.[2] But to use the wikitable class with border="1" is redundant. See User:Gadget850/wikitable for more on the wikitable CSS.
As to "so that tables can be understood anywhere they are placed even without their site CSS"; If a table using the wikitable class is ported to a site without the associated CSS, it looses more than just the border.
---— Gadget850 (Ed) talk 10:06, 29 September 2012 (UTC)

(unindent). I use Firefox browser and Vector skin. At Special:Preferences#mw-prefsection-editing I have "Enable enhanced editing toolbar" checked. This is unchecked: "Enable dialogs for inserting links, tables and more".

When I past text or tables in email or blogs they lose everything except inline styling. class=wikitable is external styling, and so it is lost.

So the only thing that remains is border=1 (quotes around "1" are optional). It is inline styling, and all it does is add a primitive border around all table cells.

Good short summaries that explain HTML 5 and border=1 in tables:

I explained it all in detail a lot better here:

That discussion links to lots of authoritative info. As to your links is good but not always comprehensive. See for why. For example; " is not affiliated with the W3C in any way. Members of the W3C have asked W3Schools to explicitly disavow any connection in the past, and they have refused to do so."

In 2008 border="1" was added to the table wikitext created by the table button on the toolbar:

Row border between last and before last row shows only in preview mode

Can somebody in the know find out what is wrong with this table in General Motors#Brand reorganization? When I go into EDIT mode of the section or the full article, and then click SHOW PREVIEW, that border shows, but after SAVE PAGE the border disappears again. I tried various things, but to no avail. I can't understand the reasons. --L.Willms (talk) 09:37, 9 October 2012 (UTC)

Try resetting your view with control+0. ---— Gadget850 (Ed) talk 09:56, 9 October 2012 (UTC)
Thanks! That did help. --L.Willms (talk) 17:31, 9 October 2012 (UTC)

Centered Text in One Column Only

Probably an easy answer out there - and I may well have jumped right past when searching in Help:Table.

Is there a way to center a single, entire, column of text? This is for a "wikitable sortable" table with many columns, where third column should be centered text, but all other text columns should not be centered. Table is long, so trying not to have to use align="center" on third entry of EACH row... would be easier to tell it that the third COLUMN is centered. Thanks. Jmg38 (talk) 20:07, 16 October 2012 (UTC)

Alas, there is no way to have an attribute apply to a whole column (well, except for column width). —EncMstr (talk) 20:35, 16 October 2012 (UTC)
Darn. Thanks for the insight.Jmg38 (talk) 05:04, 17 October 2012 (UTC)

Floating Wikitable

The coach table in this article, 2012 Nebraska Cornhuskers baseball team, will not float to the right when I am on the page but it does float when I am editing only that section of the page but not when I am editing the whole article. Thundrplaya (talk) 21:41, 18 October 2012 (UTC)

This edit moved a block of text to an earlier point which was OK, except that it took this line:
{| class="toccolours" width=95% style="clear:both; margin:1.5em auto; text-align:center;"
which is the opening line of a table, along with it. Some of the subsequent edits just made the situation worse.
I have fixed it with this edit, which has got the table formats back to how they were previously, but I've not reverted any content changes: in particular I notice that this edit has removed a 2012 reference and replaced it with a ref from 2005, which is surely not correct. --Redrose64 (talk) 23:24, 18 October 2012 (UTC)

Table too wide for page

I cannot figure out how to format this table to fit on the webpage: List of physical therapy schools in the United States

Can anyone help me out please?

Redbnr22 (talk) 04:51, 8 November 2012 (UTC)

First thing I see is the need for [brackets] around the links. --Timeshifter (talk) 00:26, 9 November 2012 (UTC)

When List of Olympic medalists in art competitions article passed FL, the rowspans for 1924 Mixed Sculpturing and Mixed Literature looked like they do at Art competitions at the 1924 Summer Olympics. Now the table doesn't seem to be recognizing the rowspan and is treating them as two separate rows and I can't figure it out. Help? — Preceding unsigned comment added by Canadian Paul (talkcontribs) 17:20, 29 November 2012

The difference is that the tables in List of Olympic medalists in art competitions are set up as sortable tables. A recent bug is described here. Be patient, and things may improved once the bug fix is deployed. -- John of Reading (talk) 17:37, 29 November 2012 (UTC)
Ah, that's fine, I'm in no rush. Glad to know that there's nothing I can do about it. Thanks for the quick response! Canadian Paul 17:41, 29 November 2012 (UTC)

Sortable table with in-table headings

I am working on a long list of dams which, for reader's ease and understanding, I want to be sortable and also have sub-headings. However with the method I am applying below, the sorting does not work properly.

Sr. No. Name Location Impounds Height Storage Capacity Year of completion
Azad Kashmir
1 Jari Dam Mirpur District Saddle dam 84 metres (276 ft) NA 1967
6 Spinkarez Dam Balochistan Nar River and Murdar River 29 metres (95 ft) 6,800,000 m3 (5,513 acre⋅ft) 1945
Khyber Pakhtunkhwa
73 Warsak Dam Peshawar Kabul River 67 metres (220 ft) 76,492,000 m3 (62,013 acre⋅ft) 1960
74 Baran Dam Bannu Baran River 24 metres (79 ft) 1962
75 Tanda Dam Kohat Kohat Toi River 35 metres (115 ft) 1967

a) Is there any way to add both in one table? b) Numbering the cells is a hectic process, every time there is a new entry or a mistake I have to modify the numbering of entire table. Is there any means to have auto-numbering? Samar Talk 17:36, 19 September 2012 (UTC)

At Help:Table#Sorting, second bullet, it states "Do not have elements spanning several columns". The sortable table feature of Mediawiki doesn't handle spanned cells. --Redrose64 (talk) 21:01, 19 September 2012 (UTC)
I am aware these don't work together but I want to know if there is a way to have both. Probably separate sections in a single table and they can sort out separately?
Try simpler designs: Samar, I understand your preferred layout. However, I think it may be asking too much of the mediawiki table capabilities. A useful design guideline is this: Make everything as simple as possible, but don't oversimplify. Applying this guideline to your table, I see two workable ways to provide the same information, and perhaps even make it more useful and accessible. They are:
  1. Keep a single table as at present, but move the (regional) sub-headings to a new column, headed, say, 'Region' or 'Province'. Because you can make the whole table sortable, readers can sort it by the 'Region' column if desired, or in any other order they please. The main drawback to this approach is a minor effect on the data presentation: keeping word-wrap enabled, each column may become narrower and therefore rows may become longer and the entire table may require more scrolling on smaller, e.g. portable, devices. There is also a small increase in the amount of data stored, as each 'Region' value is replicated for every row in its sub-table.
  2. Split the present table into one table for each (regional) sub-heading. And keep the table formats, including column headings, consistent across the whole set of tables. Yes, this might result in the occasional table with only one row after the headings, but so what? You're essentially trying to convey info about, and enable comparisons between, the same attributes (columns) in every table. So this simpler design for a set of tables will enable the reader to easily find those attributes and make comparisons between dams (rows).
One benefit of these simpler presentations is that it increases usability: those users who use screen-reader software will find them much easier to follow. With your current layout, try this experiment: Close your eyes and imagine trying to follow the information as it's read out aloud, and you'll quickly see the benefit, particularly for people unfamiliar with the territory.
Designing tables for maximum benefit is an important aspect of the job of the (relational) database designer, and both techniques above are ones we use for this purpose. Your table design problem is essentially one of designing a relational database, and both approaches are tried and tested in decades of industry practice.
In this particular case, I'd suggest trying the first approach (adding a 'Region' column). The second approach (splitting the table) runs the risk that subsequent edits may destroy the formal similarities between the individual tables, and thus their usefulness for comparisons.
As to your numbering question, consider this: Do you actually need a number for each dam? If you didn't have one, you wouldn't have to maintain it! ;-) But perhaps what you really need is not a number but a logical identifier, one which (a) uniquely identifies the dam (table row), so is the table's primary key and (b) enables easy grouping of (say) all dams for one region - which translates to using the logical ID as a (perhaps default) sort key.
So consider replacing your 'Sr. No.' column by 'ID', and making it a (simply) structured code. e.g. <region_code><serial_num>, where <region_code> is a two or three-character code for 'Region' and <serial_num> is a two-digit serial number to distinguish dams within a region. For example, using AK, BL and KP for your three current (regional) sub-headings, you might give them the following ID values:
Jari Dam AK01
Spinkarez Dam BL01
Warsak Dam KP01
Baran Dam KP02
Tanda Dam KP03
Or perhaps you want to number a region's dams by their distance from their source? For a single river, this might be their order going downstream. So instead of <serial_num> you might have <river_code><ordinal_num>.
How you choose to structure such an ID code depends on the information you want to convey, and done thoughtfully, can help you establish a default or standard sort order.
Hope this helps!
yoyo (talk) 01:52, 10 January 2013 (UTC)

"prettytable" from Italian WP

I'm trying to translate the Italian WP article "Lipsanoteca di Brescia", which has a very pretty table using an old? "prettytable" template, at User:Johnbod/Brescia Casket. I've got the images up by translating from "Immagine" to "image", but can't get the framing lines up. I've tried various things like "class="wikitable"" etc in preview but none work. Can anyone advise - feel free to try on the page. Thanks! Johnbod (talk) 13:47, 20 December 2012 (UTC)

Template:Prettytable was deleted from the English Wikipedia while the Italian still has it at it:Template:Prettytable. It works for me if all prettytable templates are replaced by class="wikitable" but you may need some of the styling from the prettytable parameters to get the wanted table layout. PrimeHunter (talk) 14:30, 20 December 2012 (UTC)
Works in that you see lines like in the Italian? I've now done that for the first table "Fronte" on mine & see no difference. Do you? Johnbod (talk) 14:36, 20 December 2012 (UTC)
Better now? -- Michael Bednarek (talk) 02:33, 21 December 2012 (UTC)
Fantastic! Thanks a lot. Johnbod (talk) 03:39, 21 December 2012 (UTC)

Need help pls

I would like to add what is below to a page - however I would like to see the text appear beside the cart and not just above and below - is this possible?Moxy (talk) 17:53, 24 January 2013 (UTC) to be seen above chart ............text

Permanent Residents Admitted in 2010, by Top 10 Source Countries
Rank Country Number Percentage
1 Philippines 36,578 13
2 India 30,252 10.8
3 China 30,197 10.8
4 United Kingdom 9,499 3.4
5 United States 9,243 3.3
6 France 6,934 2.5
7 Iran 6,815 2.4
8 United Arab Emirates 6,796 2.4
9 Morocco 5,946 2.1
10 South Korea 5,539 2
Top 10 Total 147,799 52.7
Other 132,882 47.3
Total 280,681 100


Text here .............that i would like beside chart............text

  1. ^ "Citizenship and Immigration Canada, Facts and Figures". Citizenship and Immigration Canada. 2010.
I am not completely sure what you want, but this should cover it:
Text............... above chart ............text
Permanent Residents Admitted in 2010, by Top 10 Source Countries
Rank Country Number Percentage
1 Philippines 36,578 13
2 India 30,252 10.8
3 China 30,197 10.8
4 United Kingdom 9,499 3.4
5 United States 9,243 3.3
6 France 6,934 2.5
7 Iran 6,815 2.4
8 United Arab Emirates 6,796 2.4
9 Morocco 5,946 2.1
10 South Korea 5,539 2
Top 10 Total 147,799 52.7
Other 132,882 47.3
Total 280,681 100
Text ........ beside chart ............ text
text .......... below chart ........... text
Probably you do not want the wikitable style applied to the outer table, which shows the grid lines. I added it for clarity of the technique. —EncMstr (talk) 19:44, 24 January 2013 (UTC)
Sorry I should have said were Canadians#Immigration if you scroll down you will see the map (image) File:COB data Canada.PNG - I wish to replace thus old info with the new chart but would like it to function like a image were text can flow around the chart.Moxy (talk) 19:50, 24 January 2013 (UTC)
How's this?
Permanent Residents Admitted in 2010, by Top 10 Source Countries
Rank Country Number Percentage
1 Philippines 36,578 13
2 India 30,252 10.8
3 China 30,197 10.8
4 United Kingdom 9,499 3.4
5 United States 9,243 3.3
6 France 6,934 2.5
7 Iran 6,815 2.4
8 United Arab Emirates 6,796 2.4
9 Morocco 5,946 2.1
10 South Korea 5,539 2
Top 10 Total 147,799 52.7
Other 132,882 47.3
Total 280,681 100

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst.

Fusce convallis, mauris imperdiet gravida bibendum, nisl turpis suscipit mauris, sed placerat ipsum urna sed risus. In convallis tellus a mauris. Curabitur non elit ut libero tristique sodales. Mauris a lacus. Donec mattis semper leo. In hac habitasse platea dictumst. Vivamus facilisis diam at odio. Mauris dictum, nisi eget consequat elementum, lacus ligula molestie metus, non feugiat orci magna ac sem. Donec turpis. Donec vitae metus. Morbi tristique neque eu mauris. Quisque gravida ipsum non sapien. Proin turpis lacus, scelerisque vitae, elementum at, lobortis ac, quam. Aliquam dictum eleifend risus. In hac habitasse platea dictumst. Etiam sit amet diam. Suspendisse odio. Suspendisse nunc. In semper bibendum libero.

Proin nonummy, lacus eget pulvinar lacinia, pede felis dignissim leo, vitae tristique magna lacus sit amet eros. Nullam ornare. Praesent odio ligula, dapibus sed, tincidunt eget, dictum ac, nibh. Nam quis lacus. Nunc eleifend molestie velit. Morbi lobortis quam eu velit. Donec euismod vestibulum massa. Donec non lectus. Aliquam commodo lacus sit amet nulla. Cras dignissim elit et augue. Nullam non diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In hac habitasse platea dictumst. Aenean vestibulum. Sed lobortis elit quis lectus. Nunc sed lacus at augue bibendum dapibus.

Michael Bednarek (talk) 09:48, 25 January 2013 (UTC)
Thank you so much - have added it to the page see what others think - again thank you.Moxy (talk) 21:46, 25 January 2013 (UTC)

Text Wrapping in Tables?

Peter Piper picked a peck of pickled peppers.

Just wondering, how do I get the text in the bottom row to wrap? I do not intend on putting headers in this table. (Obviously, this is just a sample.) --UltimateKuriboh (talk) 21:39, 31 January 2013 (UTC)

By default, tables are set to be wide enough so that wrapping doesn't occur. If you want wrapping, you also have to constrain the width. Since you are using images of a known size, you can force the width to be just wide enough for those images. Applying style="width:201px;" to the table will do that. --Redrose64 (talk) 21:48, 31 January 2013 (UTC)
Thanks for that! --UltimateKuriboh (talk) 22:01, 31 January 2013 (UTC)
Erm, some other unrelated questions. If I wanted to align a table in the center of the page, how would I do that? Also, how would I manage to fit 2 tables together side-by-side? For the second question, how could I provide some space between the tables, and how would I center both the tables together? --UltimateKuriboh (talk) 22:40, 31 January 2013 (UTC)
Centring a table is easy, if you know how; the style margin-left:auto; margin-right:auto; will do this, although it is by no means intuitive. Putting two tables side-by-side may be done by using a third table as a wrapper:
Peter Piper picked a peck of pickled peppers.
Peter Piper picked a peck of pickled peppers.
It's important that the {| which is used to start the two inner tables goes at the beginning of the line. --Redrose64 (talk) 23:01, 31 January 2013 (UTC)
Follow-up question: In the second set of tables, what does | style="width:100%;" do, and how does that compare to the |style="width:50%;"| that comes directly after it? --UltimateKuriboh (talk) 23:42, 31 January 2013 (UTC)
The {| style="width:100%;" opens a table and forces it to occupy the full page width, regardless of its content. The |style="width:50%;"| begins a table cell and forces it to 50% of the available width. It might seem that setting each column to 50% width (and leaving the overall width unspecified) would be a better plan, but it's a general rule with HTML tables that when forcing the widths of columns, at least one column should be left without a specified width - this allows for error, also for those browsers with peculiar calculation methods. Thus, when the second cell is started - that's the | on a line of its own - no width is set for that; and because there are no other cells on the row, the width of this second cell is forced to be 50%.
I don't know if you're familiar with HTML coding, but the equivalent in HTML would be:
<table style="width:100%;">
    <td style="width:50%;">
      (Left-hand inner table goes here)
      (Right-hand inner table goes here)
--Redrose64 (talk) 00:13, 1 February 2013 (UTC)

(unindent). I experimented a little. It seems that since the widths of all the images have been specified you can just set an overall width such as style="width:400px;" for the table that wraps them all.

It is not necessary to specify the 50% width or the 201 pixel width of the inner tables. The overall width of the wrapper table is sufficient. It also forces the text to wrap. It is not necessary to add the extra pixels (201px, 202, 401, 402, etc..) when the image widths are specified. The images will force the tables that wrap them to expand as necessary. So just add the widths of all the inner images. Combine the centering style with the width: style="width:400px; margin-left:auto; margin-right:auto;"

Peter Piper picked a peck of pickled peppers.
Peter Piper picked a peck of pickled peppers.

--Timeshifter (talk) 02:46, 1 February 2013 (UTC)

Could someone help me to make the table allow the sorting? When I click columns (eg by number of employees) it doesn't seem to do anything. Can't figure this out, and would be super grateful for a hand! Many thanks in advance. Wikidea 20:49, 9 March 2013 (UTC)

 Fixed: For a table to be sortable, every row must have the same number of cells as every other row, but one of the rows (Community and Youth Workers' Union) was one cell short.
On an unrelated matter, there's some nasty misuse of CSS there, such as width values in the class= attribute, and class values in the width= attribute. It's also not a good idea to specify widths in terms of pixels, since you don't know how wide the target screen is. --Redrose64 (talk) 23:39, 9 March 2013 (UTC)
I should have put "not a good idea to specify widths in absolute terms". Whether the measurement be pixels (px) or points (pt), it's still an absolute measure which assumes that the users screen is at least as wide as the sum of the specified widths. Relative widths are a better choice, you would use width="10%" etc. but be careful not to exceed 100%. --Redrose64 (talk) 16:45, 10 March 2013 (UTC)

Can someone help here. I'm adding a monarch column but I'm confused on how to have 3 monarchs for one person ,example:

  • Person A was Governor General (year 1788-1793)
  • Person B was Governor General (1793-1806)
  • Person C (1806-1810)
  • Monarch 1(-1788)
  • Monarch 2 (1788-1808)
  • Monarch 2 (1808)
  • Monarch 4 (1808-1813)

Three monarchs during Person C's term.

Thanks. --User 50 17:49, 30 March 2013 (UTC)

NOTE: Just check the Spanish monarchs list. By the way, I'm doing the (1764–1898) section first.

Have a look at the various rowspans I've used here. The entry for the second person is actually three table rows joined together:
# Picture Name From Until Monarch
1 Miguel López de Legazpi April 27, 1565 August 20, 1572 Monarch one
2 Guido de Lavezaris August 20, 1572 August 25, 1575
Monarch two
Monarch three
3 Francisco de Sande August 25, 1575 April 1580
-- John of Reading (talk) 18:21, 30 March 2013 (UTC)
(More) A see you posted again here and then changed your mind. I can't be much help to you this evening or tomorrow, but others will be watching this page so do post again if you need to. -- John of Reading (talk) 19:42, 30 March 2013 (UTC)

I'm not sure if what I did was right, but it doesn't look like it was split inbetween the Governor column. It looks like it only goes across one row ? --User 50 12:52, 1 April 2013 (UTC)

Hmm. I think that you coded row 55 correctly, but the "Monarch two" cell was almost as high as the rest of the row. I've added some white space to the first cell in row 55 so that the different in height is easier to see. Any good? (And, other watchers of this page, is there a better way?) -- John of Reading (talk) 13:33, 1 April 2013 (UTC)
It seems to be fixed now and everything looks okay, thanks --User 50 14:09, 1 April 2013 (UTC)
At Template:Rail line three to two I achieved a balanced vertical spacing by using six rows instead of four; two of the rows have cells containing only &nbsp;. --Redrose64 (talk) 21:20, 1 April 2013 (UTC)

Too much texts in a cell?

Hi! I would like to ask if there is a consensus regarding number of texts inside a cell, especially if a table consist of almost a hundred cells (e.g. elimination table)? I would like to address the issue on the accessibility (or should I say, the "reability and flexibility") of the table on different screen resolutions. I am referring to My Kitchen Rules (series 4) elimination table format, and it looks like this on my part. I already proposed a simpler format through abbreviations and they objected it. → FrancDeBx (talk) 18:04, 1 April 2013 (UTC)

2013 Premier league Darts

Can someone explain to me why the league table on the the 2013 Premier League Darts page has the extra |} after the table? I've seen it in the past and never been able to work out how to fix it as there seems to be nothing wrong with it. Spudgfsh (talk) 08:54, 12 April 2013 (UTC)

If you use {{Fb cs footer}}, you don't need an explicit |} as well. Unfortunately if you can't surround that template with <small> tags, so if you want small text there, your best bet may be to not use that template at all. -- John of Reading (talk) 11:09, 12 April 2013 (UTC)
This fix both eliminates the stray |} and nests the <small>...</small> correctly. --Redrose64 (talk) 11:30, 12 April 2013 (UTC)

Section link to a row

This bit about linking to a particular row within a table is either broken, both ways of accomplishing this task are the same, and/or both conditions exist. Help:Table#Section_link_to_a_row I tried to do this and it just didn't work. I ended up hardcoding a <span id=.... />. — Preceding unsigned comment added by Shmooth (talkcontribs) 16:58, 25 May 2013 (UTC)

Both ways were supposed to be different, I found that an overenthusiastic cleanup edit had made them look the same; I've put it back to how it had been previously. Using the first of those techniques, I can do this:
{| class=wikitable
|This cell is on the first row
|- id="Second row"
|This cell is on the second row
This cell is on the first row
This cell is on the second row
which creates an anchor for use as the target for Help talk:Table#Second row.
Anyway, which page did you need to add that <span id=... /> to? I can't find it in your contributions. --Redrose64 (talk) 18:00, 25 May 2013 (UTC)

Sorting help (please)

I would greatly appreciate a little bit of help. I am creating a sortable aviation-related table and I would really like to be able to individually sort the subcolumns under the heading “deaths”. Right now it will only sort the first value (TOT) but not the others. Thanks in advance for any comments or assistance. --Godot13 (talk) 04:20, 8 June 2013 (UTC)

Aeroflot aviation accidents and incidents
Deaths Incident Aircraft Location Phase Airport Distance Date ASN[1]
Tot C P G FR
178 5 169 4 97.2% Aeroflot/East Siberia Flight 3352 Tupolev Tu-154 USSR-Russia-OmskOmsk, Russia, USSR 7LDG OMS/UNOO 1984-10-1111 Oct 1984 [2]
174 10 165 0 83% Aeroflot Flight 217 Ilyushin Il-62 USSR-Russia-MoscowMoscow, Russia, USSR 7APR SVO/UUEE 11 kilometres (6.8 mi)11km (6.8mi) 1972-10-1313 Oct 1972 [3]
166 8 156 0 92% Aeroflot Flight 4227 Tupolev Tu-154B-2 USSR-Kazakhstan-AlmatyAlmaty, Kazakhstan, USSR 4ICL ALA/UAAA 5 kilometres (3.1 mi)5km (3.1mi) 1980-07-0808 Jul 1980 [4]
62 8 54 5 43% Aeroflot Flight 1036 Ilyushin Il-18V USSR-Black Sea-Russia-AdlerBlack Sea, Adler, Sochi, Russia, USSR 4ICL AER/URSS 4 kilometres (2.5 mi)4 km (2.49mi) 1972-10-0101 Oct 1972 [5]
57 8 49 2 71% Aeroflot Flight 3932 Tupolev Tu-104 USSR-Russia-YekaterinburgYekaterinburg, Russia, USSR 4ICL SVX/USSS 10 kilometres (6.2 mi)10km (6.2mi) 1973-09-3030 Sep 1973 [6]
For a column to be sortable, it must have a header cell on the top row; thus there cannot be any colspan= on the top row. If you exchange the top two rows, like this
Aeroflot aviation accidents and incidents
Tot C P G FR Incident Aircraft Location Phase Airport Distance Date ASN[7]
it will be sortable.
Please also note that I altered scope=”col” to scope="col" - whilst the reasons for preferring 'typewriter' or straight quotemarks over 'typographic' or curly quotemarks in running text are mainly stylistic, in Wiki markup only the straight form (" U+0022 Quotation Mark) will work because other characters which look similar (including, but not limited to, U+201C Left Double Quotation Mark U+201D Right Double Quotation Mark U+2033 Double Prime) are completely different from a technical point of view. --Redrose64 (talk) 08:21, 8 June 2013 (UTC)
  • Thank you so much for the help! What you did makes perfect sense... --Godot13 (talk) 14:40, 8 June 2013 (UTC)
  1. ^
  2. ^ "ASN Accident Description (Aeroflot/East Siberia-3352)". Aviation Safety Network. 1984-10-11. Retrieved 2013-05-27. {{cite web}}: External link in |website= (help)
  3. ^ "ASN Accident Description (Aeroflot-217)". Aviation Safety Network. 1972-10-13. Retrieved 2013-05-27. {{cite web}}: External link in |website= (help)
  4. ^ "ASN Accident Description (Aeroflot-4227)". Aviation Safety Network. 1980-07-08. Retrieved 2013-05-27. {{cite web}}: External link in |website= (help)
  5. ^ "ASN Accident Description (Aeroflot-1036)". Aviation Safety Network. 1972-10-01. Retrieved 2013-06-05. {{cite web}}: External link in |website= (help)
  6. ^ "ASN Accident Description (Aeroflot-3932)". Aviation Safety Network. 1973-09-30. Retrieved 2013-05-27. {{cite web}}: External link in |website= (help)
  7. ^

Collapsing with caption as title

I want to make a collapsible table but I want the caption to be the title of it. When I use this code:

{| class="collapsible wikitable collapsed" style="text-align:center;" width="55%" align="center"
|+ Performances in ''The X Factor'' (Greece)
|- "
! style="text-align:centre" |Show
! style="text-align:centre" |Song choice <small>(original artist)
! style="text-align:centre" |Result
! Auditions
| {{n/a}}
| Through to bootcamp
! rowspan="2"| Bootcamp
| "[[Just Walk Away]]" <small>([[Céline Dion]])
| rowspan="2"|Through to judge's house
| "[[I Have Nothing]]" <small>([[Whitney Houston]])

I get this:

But I want the [hide]/[show] to be on the Performances in The X Factor (Greece). How can I fix it? Dimitris(talk) 11:39, 16 June 2013 (UTC)

Color header and sortable?

Is it possible to have a sortable table and set a custom color for the header? Whenver I try it, the table is still sortable, but the arrows don't appear. For example, using this markup:

{| class="wikitable sortable" style="font-size:90%"

|- style="text-align:center;"
! style="background:#B0C4DE;" | Award
! style="background:#B0C4DE;" | Year
! style="background:#B0C4DE;" | Category
! style="background:#B0C4DE;" | Work
! style="background:#B0C4DE;" | Outcome

| [[Academy Awards]]
| [[Academy Award for Best Supporting Actor|Best Supporting Actor]]
| ''[[Dreamgirls (film)|Dreamgirls]]''

|rowspan=3| [[Annie Awards]]
|Outstanding Individual Achievement for Voice Acting in an Animated Television Production
|''[[The PJs]]''


I get:

Award Year Category Work Outcome
Academy Awards 2007 Best Supporting Actor Dreamgirls Nominated
Annie Awards 1999 Outstanding Individual Achievement for Voice Acting in an Animated Television Production The PJs Nominated

The color is applied, but the arrows aren't visible in the header cells. It's like applying a color strips away the sortability. Any way to solve this? — Frεcklεfσσt | Talk 02:45, 19 June 2013 (UTC)

Need some quick col/row scope MOS:DTT work on a pending FLC

User:The Rambling Man who is a director at FLC has informed me in reviewing my nomination for List of colonial governors of New Jersey that I would need to make the tables compliant with MOS:DTT for col and row scopes. I've told him I don't know what this is. After several requests, he gave me an example to go by that when I tried to implement screwed up the tables. So, please can someone from this page help fix this to make it MOS:DTT-compliant and then tell me what exactly I have to do for future reference?

See the discussion here (at the bottom of the page): Wikipedia:Featured list candidates/List of colonial governors of New Jersey/archive1

Thanks for any assistance someone can offer.--ColonelHenry (talk) 19:00, 14 July 2013 (UTC)

Responded on that page. --Redrose64 (talk) 06:49, 15 July 2013 (UTC)

table best represented in source as its transpose?

any suggestions for how to code a table that (imao) is best represented in the source as its own matrix transpose?

the specific case i'm looking at is side-by-side translation: the table has one column for each language, and one row for each paragraph. the paragraphs are much too long for the literal side-by-side (double-bar) format to be viable, and the normal way to code the table would be

language A language B
paragraph 1 (A) paragraph 1 (B)
paragraph 2 (A) paragraph 2 (B)
|language A
|language B
|paragraph 1 (A)
|paragraph 1 (B)
|paragraph 2 (A)
|paragraph 2 (B)

what i'm looking for is some way to render the same table, but where the code looks more like

|language A
|paragraph 1 (A)
|paragraph 2 (A)
|language B
|paragraph 1 (B)
|paragraph 2 (B)

so that each language's whole text forms a coherent text in the source

the only thing i can think of at the moment is nested tables, but i know they're discouraged, so i wanted to ask if there were any other possibilities. Adavies42 (talk) 18:30, 21 August 2013 (UTC)

No. Although the syntax is very different, we follow the HTML table model (in simplified form), in that a table is composed of an optional caption and a mandatory body; the body is composed of one or more rows; the rows are composed of cells. Therefore the whole of one row must be described before the next row is commenced. Since HTML provides no means for describing a table in a column-by-column form, we don't either. --Redrose64 (talk) 19:18, 21 August 2013 (UTC)