Jump to content

User:Jodosma/tables

From Wikipedia, the free encyclopedia

Tables are covered in lots of WP articles in which a lot of stuff about the creation of tables is discussed in a very esoteric way. In this essay I will attempt to cut out a lot of unnecessary information and just explain how to make the ordinary kind of table you often come across in Wikipedia articles.

For instance, how do you make a table with headings in both rows and columns? By "headings" I mean the text you see in a cell in a table which is emphasised in some way. In Wikipedia this is usually accomplished by displaying it in a bold way. This is a very simple intro and you can see how anything mentioned here (e.g. bold and italic) has been achieved by clicking on the Edit button at the top of the page or here. If you do that you will see that bold is made by preceeding the word to be emboldened with three quotes, ('''), and then followed by three quotes.

The first table we shall make is the most basic; just a few rows and columns. To illustrate the idea I will use the written form of numbers. (The examples given by other articles always use the minimum number of columns and rows to "demonstrate" their point but this article will be much more accessible. I will try to give answers to all your questions such as "What if the columns aren't that size" or "What if I want to display different sizes of rows or columns", and how can I have different sizes of rows and columns in the same table. Stay with me, below this example is another one whose format I have borrowed from the article Billy Mould

First col heading Second col heading Third col Fourth col Hundredth column
Entry 1 Entry 2 Entry 3 Entry 4 Hundredth entry
Club (rowspan=2) hello Season (rowspan=2) League (colspan=3) and more FA Cup (colspan=2) are you noticing my width Total (colspan=2) and mine because my width is greater
Division Appearances Goals Apps Goals Apps Goals
Rowspan is 9 put side heading here thirty seven-thirty eight First Division of good stuff 10 0 0 0 10 0
Year 89-90 First Division 22 0 2 0 24 0
Year 90-91 First Division 30 0 5 0 35 0
Year 91 - wider this heading First Division 40 0 2 0 42 0
Year you must be joking! First Division 25 0 0 0 25 0
fortynine to fifty First Division 7 0 0 0 7 0
fifty to fiftyone First Division 20 0 4 0 24 0
fiftyone to fiftytwo First Division 23 0 4 0 27 0
Colspan is two 177 0 17 0 194 0
(rowspan=three) 1952–53 Third Division North 40 1 0 0 40 1
1953–54 Third Division North 26 0 3 0 29 0
Total 66 1 3 0 69 1
Career Total (colspan=three) 243 1 23 0 265 1

The above example shows how it is possible for headings of both rows and columns to cover different "spans", i.e. one row heading may head more than one row and one column heading may cover more than one column. Note that all headings (formatted by using ! instead of | at the start of each statement in the edit window) are automatically centred by the Wiki software, but all other entries must be formatted individually. Also all columns expand to accommodate the widest of all column entries according to the width of the column headings (not the width of the entries in the cells). If a field starts with a ! then the whole row following is in bold.