Jump to content

Help talk:Table

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Bluesoju (talk | contribs) at 09:47, 3 August 2009 (→‎Centering a wiki table). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Column equivalent to line word wrap for long two column tables

I have a two column table where I can sort on each column and each column is of minimal width. So with my many entries I get a very long but narrow table and so have to scroll up and down many pages to find my entries as I switch back and forth between sorts. How can I make the length of the page presentation shorter by breaking the long table into three (or even more) parts that are beside each other and still be able to have the sorts include all row data from my original long table? I will also post this at the Help desk. (Also, not sure if I should post at top or bottom of this page - let me know - thanks.) Newwhist (talk) 00:41, 7 June 2009 (UTC)[reply]

Entire cell is a link?

Is it possible to make the entire cell a link? I was hoping to build a large grid where the background color of each cell indicates a status, and is a link. Is this possible or would I have to do something like

{|
|-
|[[User:na85/link| ]]
|}

?

Na85 (talk) 09:57, 15 January 2009 (UTC)[reply]

Table title overlapping with text

In the article European Patent Convention, the table title "Contracting States to the European Patent Convention, with respective date of entry into force" overlaps with the text (I am using Firefox 3.0.5 on Windows Vista). Can anybody help me to solve this? Thank you in advance. (The problem does not arise using Safari 3.2.1, while the layout on Internet Explorer 7.0.6001... is just awful..) Cheers. --Edcolins (talk) 13:12, 24 January 2009 (UTC)[reply]

I'm also using Firefox on Vista (Home Premium), and I can reproduce the problem (as non-logged in user too). I had to change the window width just right until the "Contracting States to" text completely overlaps the "does not totally overcome" text in Background and rationale. Netscape 9.0.0.6 (I use to simulate Firefox 2 behaviour) has a much reduced overlap of just 2 or 3 pixels. Opera 9.63 has no problem. I dare not open IE as it has given me much grief. My guess is Mozilla still has improvements to make with layout. Someone (not me, I'm lazy today) needs to create a html fragment that reproduces the problem and submit a bugzilla report. 78.14.225.21 (talk) 13:21, 25 January 2009 (UTC)[reply]
Any other idea to solve this? --Edcolins (talk) 17:30, 14 February 2009 (UTC)[reply]

Useless section

The Wikitable as image gallery section is completely unintelligble. It needs to be rewritten by a native English speaker. SharkD (talk) 01:01, 27 January 2009 (UTC)[reply]

  • 15-April-2009: I wrote that section, and I AM a native English speaker. However, I have been editing Wikipedia articles for 4 years (also translating with German Wikipedia, where some of those images are used), so that section "Wikitable as image gallery" has been placed near the bottom of the article, as a subject intended more for long-term users. That is a typical tactic, as a help-page progresses, the topics can become more specialized, but cover many details not addressed at the introduction. -Wikid77 (talk) 22:18, 15 April 2009 (UTC)[reply]

Swap columns in large tables?

Is there a way to easily swap two columns over in a table? In the past I've done this by hand, but that takes a long time for large tables. Thanks. Mike Peel (talk) 14:49, 14 February 2009 (UTC)[reply]

Copy it to Excel or OpenOffice Calc, make your changes, then use the Excel-to-Wiki Converter. --—— Gadget850 (Ed) talk - 15:36, 14 February 2009 (UTC)[reply]

How do i centre whole columns in a table?

Is this possible? Thanks, IAmTheCoinMan (talk) 15:05, 14 February 2009 (UTC)[reply]

1. Images and right-floating tables 2. Borders and cellpadding

Two problems:

1. How can I locate images to the right when there is already a right-floating table (a chronology)? I have used a table kludge at the top of Dura-Europos. I hope there's a better more consistent way. There are a few other images that I have moved left because of the chronology, but would like on the right and if there is a better way I'd happily use it. Using a table will make editing difficult.

2. How would I get a table which was a border like class="wikitable", but which allows me to use cellpadding. When I tried cellpadding to give text a bit of air in a wikitable, it didn't work. So, how would I get both cellpadding and a fine border?

Thanks for any pointers. -- spincontrol 21:53, 21 February 2009 (UTC)[reply]

  • 10-April-2009: For problem 1, a single image can be placed in a floating-table (style="float:right;"). To explain the details, I added an entire section to the "Help:Table" page; see:
Help:Table#Floating images in the center.
For problem 2, use style="border:1px solid #CCC" as noted in another section I added; see:
Help:Table#Setting borders.
Apparently, those 2 problems are quite common, and I happened to address both of them when expanding the Help:Table page. -Wikid77 (talk) 00:21, 11 April 2009 (UTC)[reply]

Coloured columns

I've created People who have served in both Houses of the Australian Parliament, and I want to colour some of the columns. I want the 3 columns under Senate to be a light red or pink and the 3 columns under House of Representatives to be a light green. These colours reflect the colours used by those chambers, and this will make the table more readily comprehensible.

I think I've worked out how to colour a single cell, but there seems to be no info on how to colour an entire column in a single command. I don't want to have to apply colour to every cell separately. Is there a quick way to do this that has escaped my notice? Thanks. -- JackofOz (talk) 03:06, 24 March 2009 (UTC)[reply]

Ultimately, each box must be colored separately. However, this can be eased by using a table editing tool, such as an HTML editor, capturing the resulting HTML table, and replacing the table in the article with it. Needless to say, this will be ugly wikitext and a pain to maintain. There are tools for converting HTML tables to wikitables, but the underlying complexity will remain. Another method would be to use templates in the cells to provide colors, such as at periodic table (standard). —EncMstr (talk) 04:15, 24 March 2009 (UTC)[reply]
I was afraid that would be the answer. Isn't it a bit odd that a row can be coloured with one simple command, but a column can't? Given the number and variety of tables in WP, it's very surprising that some attention hasn't been paid to this issue before now. Thanks anyway.
PS. Maybe it would be good to state explicitly that column colours have to be done this way, rather than having people have to scout around for the information and needing to ask the question. Just a suggestion. -- JackofOz (talk) 05:35, 24 March 2009 (UTC)[reply]

Added subsection: Setting borders

8-April-2009: I have added subsection "Setting borders" as a new subsection about using the typical thin, solid box-borders. It has a few short examples about putting borders around the table, or individual cells, using a style-parameter (style="border:1px solid darkgray;"). -Wikid77 (talk) 21:56, 8 April 2009 (UTC)[reply]

Retrofit talk-page year headers/subpages

10-April-2009: I have added subheaders above as "Topics from 2007" (etc.) to emphasize the dates of topics in the talk-page. Older topics might still apply, but using the year headers helps to focus on more current issues as well. Afterward, I dated/named unsigned comments and moved entries (including "Entire cell...") into date order for 2009. -Wikid77 (talk) 16:45, 8 April 2009

Archived rest of 2007

10-April-2009: I have moved the remainder of 2007 topics into the Archive_1 page, to keep all of 2007 in one archive file. If a topic isn't covered on this page, the archive file might have that topic, with answers or examples.

I kept 2008's topics in this file for easy review of answers/examples. -Wikid77 17:41, 10 April 2009

I went ahead and archived 2008 and added the archive banner. Show will give you the links and the search box. --Gadget850 (talk) 23:18, 10 April 2009 (UTC)[reply]

2nd generation Help:Table

10-April-2009: I have begun reformatting the Help:Table page, as a 2nd-generation level, to expand more about setting table borders, describe image formatting, and condense the page by shortening examples and removing excess blockquote boxes. The changes are as follows:

  • added new section "Setting borders" - to explain the thin/solid borders.
  • added new section "Floating images to the center" to show use of the style="float:right" (or "float:left").
  • moved section "Displaying the table code which generates a table" into new page named "Help:Display markup examples".
  • removed 27 blockquote boxes that double-boxed the wiki markup code.
  • at Comparison of HTML syntax, narrowed the table width=590px & removed the 2nd "Data cell" and second Sample table of 6 items.
  • at Comparison of HTML syntax, updated the Pros/Cons area, noting that some indented HTML code might not match the nesting, and putting "tr" for a "td" can cause confusion for hours.
  • for the simple examples, changed red highlighting to medium brown ("#AA6633") to avoid red-linked appearance.

The intent is to broaden the coverage of Help:Table, while streamlining the level of detail to avoid excessive formatting. Although more than 350 small changes have been made, the overall effect is a massive copyedit activity, while adding or removing sections, but NOT a radical change in appearance. The page will still seem generally familiar to previous readers. -Wikid77 (talk) 00:21, 11 April 2009 (UTC)[reply]

tables within text?

Hi! Is there a way to use tables within paragraphs, similar to the way we can use images? What I want to do is something like this [with image]

Hohhot (Mongolian: , Kökeqota; Chinese: 呼和浩特; pinyin: Hūhéhàotè), sometimes spelled Huhehot or Huhhot, is a city in North-central China and the capital of the Inner Mongolian Autonomous Region, serving as the region's administrative, economic, and cultural centre. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc.

but with the image replaced by a table.

[not like this - the table should be between the "Mongolian" and the "Kökeqota", not somewhere outside the paragraph!]

Template:MoBi
Template:MoBi
Template:MoBi
Template:MoBi
Template:MoBi
Template:MoBi

Hohhot ([] Error: {{Lang-xx}}: no text (help) Kökeqota; Chinese: 呼和浩特; pinyin: Hūhéhàotè), sometimes spelled Huhehot or Huhhot, is a city in North-central China and the capital of the Inner Mongolian Autonomous Region, serving as the region's administrative, economic, and cultural centre. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc.

Is there some way to achieve this? Yaan (talk) 13:52, 15 April 2009 (UTC)[reply]

27-Apr-2009: For years in HTML, a table has always forced an implicit line-wrap (or line-break), so to keep a table within a line, the work-around is to put the whole line into a table, then imbed a table-within-a-table, using the outer table to force the whole line to stay together. I have created a new sub-section, under the "Examples" section; see:
For more flexibility, those examples use the standard HTML tags "<table>" & "<tr>" & "<td>". -Wikid77 (talk) 22:41, 27 April 2009 (UTC)[reply]

Table help

Hi, Could someone with the know-how fix the results tables on Pop Idol (UK series 1) and Pop Idol (UK series 2). I copied the format from the The X Factor (UK series 5) article but have had difficulty with alignment. Thanks. 03md 20:00, 30 April 2009 (UTC)[reply]

Table appears at bottom of page

Can someone make this table appear in the proper location: Wikipedia_talk:Lists#Lists.2FTables? Thanks! --Ronz (talk) 18:43, 1 May 2009 (UTC)[reply]

Fixed. --Ronz (talk) 21:54, 1 May 2009 (UTC)[reply]

Decimal point alignment issues

It seems to me that the decimal point alignment guidelines need to be updated. The current recommendation creates semantically broken html output.

For example, this wiki code: |align="right"| 432 || .1

Generates this output: <tr><td align="right">432</td><td>.1</td></tr>

This does not appear to be broken for a typical visitor. However, the html in fact contains two numbers, 432 and 0.1 - instead of one number, 432.1. This is a problem for search engines (like Google) and semantic engines, and also for text-only browsers and text readers.

I think that it would be a good idea to remove the decimal point alignment section until a better alternative is found.

--Kuteni (talk) 10:26, 16 May 2009 (UTC)[reply]

What is this color?

Resolved

What is the name or HEX code for the background color of talkpages (like this page, or your user talkpage)? This is also the background color of help, and category pages. Debresser (talk) 10:50, 19 May 2009 (UTC)[reply]

Is there a choice "transparent"? Debresser (talk) 11:01, 19 May 2009 (UTC)[reply]

WP article background is #F8FCFF  . I figured this out a long time ago by looking at the page source, but have found it documented at Wikipedia:Colours. ---— Gadget850 (Ed) talk 11:33, 19 May 2009 (UTC)[reply]
Thanks again. I have also found the answer to my second question on the help page itself. I quote: "To make the table blend in with the background, use style="background:none" or style="background:transparent". (Warning: style="background:inherit", does not work with some browsers, including IE6!)" Debresser (talk) 13:43, 19 May 2009 (UTC)[reply]

Frankly I don't know why we don't use this by default in common.css:

table {
    background:transparent;
    }

White tables against a non-white background look really bad. — CharlotteWebb 02:08, 5 July 2009 (UTC)[reply]

Margin

Table in HTML
Suppose we have this table floating leftThe text at the right of the table...
...is brimming over the tablewhat parameter should we use to correct that ?
  • This text is running over the table.
  • It clearly run over now
  • What must be add in the table ? a "margin" ? How ?
  • Also in the HTML code, what should we add in the table tag ?
  • Pahapah (talk) 20:00, 24 May 2009 (UTC)[reply]

If you use class "wikitable" it does not overlap. — CharlotteWebb 01:54, 5 July 2009 (UTC)[reply]

Proposed enhancements to table sorting (rowspan/colspan support)

See en:Wikipedia:Village pump (proposals)#Proposed enhancements to table sorting (rowspan/colspan support). -- Tcncv (talk) 02:55, 27 May 2009 (UTC)[reply]

Swap Rows and Columns

Is there a tool for switching the rows and columns in a Table ("inverting" it) ?

Where are there tools for working with WP tables? -96.233.30.237 (talk) 19:28, 6 July 2009 (UTC)[reply]

I know of no purpose-specific tool for rearranging a table. It would be interesting to write though. I'll give it some thought.
The various Wikipedia tools are scattered on the toolserver at http://toolserver.org/ and in other places. A listing of projects is here, though the only table-related utilities are for converting HTML to wikimarkup and converting tab-delimited data to tables. —EncMstr (talk) 19:50, 6 July 2009 (UTC)[reply]

Yesterday I stumbled on an article with a big bad table [Comparison of S.M.A.R.T. tools]. It would be so much work to fix (swap the rows and columns) by hand that no one is going to do it -- the article will just hang around and fester... In general, working with WP tables is a nuisance, harder than it should be -- and not just for newbies. And often the results grow to be unusable -- there needs to be good ways to have big tables underlying the article, but view just the parts that interest you at the moment. I often read "comparison of" articles that contain info I am very interested in, but I give up because the info is spread over multiple tables in a way that makes it hard to digest (which program is no-cost, current, runs on Linux, and offers feature X?)

The csv2wp tool is not well supported. And there seems to be no complementary wp2csv table tool. That sounds pretty simple, and then simple tables could get converted to spreadsheets, where I guess it is easy (transpose or switch Excel row or column data) to do useful things. Hope you get inspired to work on this! -96.233.30.237 (talk) 11:28, 7 July 2009 (UTC)[reply]

Centering a wiki table

I've been trying this:
class="wikitable" align="center" style="text-align:center"
and it hasn't been working. How do I center a wikitable on the page? --Bluesoju (talk) 14:04, 8 July 2009 (UTC)[reply]

You should wrap the table into div tags. Ruslik_Zero 15:14, 8 July 2009 (UTC)[reply]
Wonderful, it worked like a charm. Thank you for your help sir. --Bluesoju (talk) 07:46, 9 July 2009 (UTC)[reply]

Weird results now, not sure what happened, in google chrome it doesn't center, in firefox only the table text at the top centers, in ie centers, an example:http://www.koreanwikiproject.com/wiki/index.php?title=Getting_started.

My basic code:

<div>
{| class="wikitable" align="center"
|-
|+Grammar Syntax
! Syntax !! Meaning !! Example !! Comment
|-
| A || Adjective (descriptive verb) || [[A + 구나]] || Adjective (descriptive verb) only pattern.
|-
| A/V || Adjective or Verb || [[A/V + 지만]] ||Adjective or verb may be used in this pattern.
|-
| N || Noun || [[N + (으)로]] || Noun only pattern
|-
| S || Sentence || ||
|-
| V || Verb (action verb) || [[V + (으)ㄹ 게요]] || Verb (action verb) only pattern.
|-
| +  || Attach the thing before and after the + symbol. || The adjective 춥다: 춥 + 지요 → 춥지요 || The verb stem is 춥 from 춥다(to be cold), gets joined with 지요.
|-
| (으) || If there is a [[받침]] add a 으. || [[A/V + (으)니까]] || -
|-
| (으)ㄹ || If there is a [[받침]] add 을 (으 being the optional grammar) otherwise add ㄹ as the [[받침]]. || [[A/V + (으)ㄹ지도 모르다]]
|If there is
|- -
| (으)ㄴ || If there is a [[받침]] add 은 (으 being the optional grammar) otherwise add ㄴ as the [[받침]]. || [[A + (으)ㄴ가요]] || -
|-
| (스)ㅂ || If there is a [[받침]] add 습 (스 being the optional grammar) otherwise add ㅂ as the [[받침]]. || [[A/V + (스)ㅂ니다]] || -
|-
| (이) || If there is a [[받침]] attach 이. Often used in conjunction with nouns. || [[N + (이)나]] || -
|-
| (  ) || The part inside the parenthesis is optional. || [[V + (으)ㄹ 수(가) 있다]] || The 가 is optional.
|-
| a/b || Either a or b || [[A/V + 아/어/여]] || Depending on the rule, you either pick 아, 어 or 여.
|}
</div>

Bluesoju (talk) 11:12, 2 August 2009 (UTC)[reply]


Try setting the margins to auto— this makes the left and right margins equal, which centers the table:

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

---— Gadget850 (Ed) talk 11:24, 2 August 2009 (UTC)[reply]

Works great! Thanks - --Bluesoju (talk) 09:47, 3 August 2009 (UTC)[reply]

Alt text

Hello. Would whoever is maintaining tables please consider adding an "alt=" field so that editors may comply with WP:ALT? Thanks. -SusanLesch (talk) 03:25, 15 July 2009 (UTC)[reply]

WP:ALT does not apply. Tables are not images. They are basic page layout directives. They can contains images and/or text and/or other items (controls, formulae, etc.), but they can always be rendered. —EncMstr (talk) 05:25, 15 July 2009 (UTC)[reply]
OK if you say so. A table can contain an image which needs to have alt text but the image template doesn't work with alt inside table. -SusanLesch (talk) 05:39, 15 July 2009 (UTC)[reply]
Really? (What image template?)
Mount Hood wildflowers
text text
text text text text
Is this not behaving correctly? —EncMstr (talk) 05:50, 15 July 2009 (UTC)[reply]
Yes as far as it goes. I think (but don't know) that the alt field is visible only to screen readers. I found this problem in Northwestern Consolidated Milling Company but can imagine that many list articles (list of tallest buildings in such and such a city and so on) would also put images inside table. -SusanLesch (talk) 05:58, 15 July 2009 (UTC)[reply]
Oh for dumb! Sorry EncMstr. I made a typo "|alt=the Crown Roller mill in winter (contemporary photo)|". Putting alt inside the image link works just fine! -SusanLesch (talk) 07:00, 15 July 2009 (UTC)[reply]
This question came from a similar one about the gallery template. I jumped to the conclusion that there was a problem here in table. Again sorry! -SusanLesch (talk) 16:21, 15 July 2009 (UTC)[reply]

how to align whole column to the right? col-style

There is broadly explained the decimal alignning Help:Table#Decimal_point_alignment, but how to align whole column to the right? How to assign a style to a whole column? ...It is possible to put there such style rule to EVERY row of the table, but a) that is really annoying at log tables, and b) a source of mistakes beause of repeated "worthless typing". Any clue? Thanks. --Franta Oashi (talk) 01:50, 16 July 2009 (UTC)[reply]

The first idea I had was related to "col-group", but I doubt such is supported by all (enough) browsers.

Another solution I can imagine is to make such param to the wiki-col syntax for tables: {| |- | |}. That would need to enhance the internal WP interpreter to accept such new col-param. The result could be i.e. the style for every cell in the col on every row. ...we have machines to make repettive operations, let's get rid of the ugly WP page-coce! Or does such behaviour/syntax exist already?? --Franta Oashi (talk) 01:50, 16 July 2009 (UTC)[reply]

I don't think there is any way to do that without repetition for each row, just like coloring a column. —EncMstr (talk) 05:35, 16 July 2009 (UTC)[reply]
I was afraid so. Then, let the repetition is done automaticaly, by the server machine. --Franta Oashi (talk) 02:52, 17 July 2009 (UTC)[reply]

Tool to add a column

Is there are tool which will add a column into the middle of an existing wiki-markup table? Perhaps a third-party WYSIWYG editor, into which the markup is pasted? Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 20:00, 18 July 2009 (UTC)[reply]

Only way I know of it to copy the table to Excel or similar, edit it, then convert back to wikimarkup. ---— Gadget850 (Ed) talk 20:42, 18 July 2009 (UTC)[reply]
Thank you, that works for simple text content, but not if the table includes markup such as inline styles and links. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 22:01, 18 July 2009 (UTC)[reply]