Help talk:Table/Archive 5
![]() | This is an archive of past discussions about Help:Table. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | ← | Archive 3 | Archive 4 | Archive 5 | Archive 6 | Archive 7 | → | Archive 10 |
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)
Questions
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)
|-class=unsortable
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)
- 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)
- 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)
- 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)
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.
- Result:
This line is more text after the outer table.This is a test table here HELLO WORLD followed by this text afterward.
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.
- Result:
This line is more text after the outer table.This is a test table here HELLO WORLD followed by this text afterward.
--William H. Magill 01:02, 18 May 2012 (UTC) — Preceding unsigned comment added by Whmagill (talk • contribs)
- 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)
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? --95.208.204.253 (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)
bug
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. | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
![]() t2 |
![]() a |
![]() dz-aang |
![]() |
![]() e |
![]() f-ot |
![]() ng-ang |
![]() h-ei |
![]() i |
![]() j-oey |
![]() t3 |
![]() aan | ||
![]() t6 |
![]() g-aak |
![]() l- |
![]() m-m |
![]() n-on |
![]() o |
![]() b-aap |
![]() gw-uk |
![]() k-ik |
![]() s-oen |
![]() d-aat |
![]() aau |
![]() aam | ||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() | ||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() | ||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
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 tried setting the style for each row, with
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
|
I haven't studied the templates enough to understand it all.
- Template:Braille cell.
- Template:braille cell/core and so on. Font sizing and tables is a complex issue. --Timeshifter (talk) 03:23, 1 September 2012 (UTC)
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]
( | |||
---|---|---|---|---|
Disease or condition | Psychoanalysis | Cognitive behavioral therapy |
Family or couple therapy | |
Schizophrenia (acute phase, with drugs) |
![]() |
![]() |
![]() |
- ^ ibid. see full table
- Is this what you are aiming for?
Effectiveness of psychotherapy treatment in adults[1]
( | |||
---|---|---|---|
Disease or condition | Psychoanalysis | Cognitive behavioral therapy |
Family or couple therapy |
Schizophrenia (acute phase, with drugs) |
![]() |
![]() |
![]() |
- ^ ibid. see full table
- 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. 85.226.207.245 (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|
- to
| 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 definesborder:1
, so that is redundant, and you don't need thewidth
here. I usedmargin
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.wikitable,
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 withborder="1"
is redundant. See User:Gadget850/wikitable for more on thewikitable
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 w3schools.com is good but not always comprehensive. See w3fools.com for why. For example; "W3Schools.com 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:
- MediaWiki_talk:Common.css/Archive 5#Wikitable borders without CSS. See discussion section above it too. --Timeshifter (talk) 11:50, 29 September 2012 (UTC)
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 (talk • contribs) 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)