Wikisource:WikiProject 1911 Encyclopædia Britannica/Style Manual/Table examples

Table examples edit

This is a sub-page of Wikisource:WikiProject 1911 Encyclopædia Britannica/Style Manual its purpose is to show some example tables from the pages of the Encyclopædia Britannica, to enable editors to use wikitable syntax to construct table that look similar to those used in Encyclopædia Britannica articles.

Some of these examples use the template {{Table style}} in its shortened form {{ts}}

Writing sideways edit

Here are two ways to change the text to write sideways. The first uses style="writing-mode: vertical-rl;" it writes top to bottom. The second is to use a table style="writing-mode: sideways-lr;" this writes bottom to top. The template {{vrl}} can be use in place of vertical-rl.

One problem with sideways writing is the height of the cell. It will probably be necessary to reduce the height by breaking the text into lines using the carriage return html <br/>.

An additional problem is the width, because this feature does not automatically set the width. Often the text in the other columns will mean that the columns are wide enough to handle the width of the text but it may be necessary to do so by some other method. In this example cellpadding="50" is used

{|class="tablecolhdborder" cellpadding="50" 
|{{Vrl|This is a vrl example}}
|style="writing-mode: vertical-rl;"|This is a "vertical-rl" example
|style="writing-mode: sideways-lr;"|This is a"sideways-lr" <br/>example
|}
This is a vrl example
This is a "vertical-rl" example This is a"sideways-lr"
example

Here is another example using style="width: n%" the {{ts|w30}} next to the class sets the percentage of the width of the display window that the table will take up. The style="width: n 15%" takes up 15% of the initial 30% of the width. The last column take up whatever percentage is left (in this example 100-(15+25) = 60% so it and that is 60% of the initial 30% or about 16% of the width of the display. This method allows for the tailoring of the width of columns, but unlike the cellpadding="50" above you need to check that this displays well on small screens (such as phones).

{|class="tablecolhdborder" {{ts|w30}}
|style="writing-mode: vertical-rl; width: 15%;"|This is a "vertical-rl" example
|style="writing-mode: vertical-rl; width: 25%;"|This is a "vertical-rl" example
|style="writing-mode: sideways-lr;"|This is a"sideways-lr" <br/>example
|}
This is a "vertical-rl" example This is a "vertical-rl" example This is a"sideways-lr"
example


For an example see Page:EB1911 - Volume 28.djvu/409 (Water Supply)

Tables with no horizontal line in the columns (tablecolhdborder float) edit

Here is an example (from "Mesopotamia" volume 31 page 915 ) using a class "tablecolhdborder" and the template "{{ts}}". For a further explanation see Help:Templates and Template:Table style/doc.


By default this class of table will appear on rows of its own its own in the center of the page. If this table is to appear on the left or the right with text next to it then append floatright or floatleft to the class eg class="tablecolhdborder floatright". Below are three identical tables apart from the use float. They are ordered floatright, center (the default) and floatleft. This is only for demonstration proposes. In the wild you would probably not want to do this as the ordering of the tables will vary as the screen gets narrower.

Place Number of years Annual average rainfall in inches
Basra 18 6-68
Bagdad 29 6-64
Mosul 4 16-71
Place Number of years Annual average rainfall in inches
Basra 18 6-68
Bagdad 29 6-64
Mosul 4 16-71
Place Number of years Annual average rainfall in inches
Basra 18 6-68
Bagdad 29 6-64
Mosul 4 16-71
{|class="tablecolhdborder floatright" {{ts|ac}}
 |-
 !Place
 !Number of years
 !Annual average rainfall in inches
 |-
 |{{ts|al}}|Basra|||18||6-68
 |-
 |{{ts|al}}|Bagdad||29||6-64
 |-
 |{{ts|al}}|Mosul||4||16-71
 |}
{|class="tablecolhdborder floatleft" {{ts|ac}}
 |-
 !Place
 !Number of years
 !Annual average rainfall in inches
 |-
 |{{ts|al}}|Basra|||18||6-68
 |-
 |{{ts|al}}|Bagdad||29||6-64
 |-
 |{{ts|al}}|Mosul||4||16-71
 |}
{|class="tablecolhdborder" {{ts|ac}}
 |-
 !Place
 !Number of years
 !Annual average rainfall in inches
 |-
 |{{ts|al}}|Basra|||18||6-68
 |-
 |{{ts|al}}|Bagdad||29||6-64
 |-
 |{{ts|al}}|Mosul||4||16-71
 |}

Tables with no horizontal line in the columns (tablecolhdborder) edit

Here is a fragment example from the article "Irrigation" (volume 14, p. 815.). This example uses the same class="tablecolhdborder but, it specifies a maximum width and adds a line under the titles to turn them into boxes and removes one line between the column containing line counter and the major works names. It also demonstrates how the table can align by default all the text to the right, and then change that default per line or per cell.

Irrigation. Area Watered. Total Revenue. Total Expenditure. Net Revenue. Capital and Indirect Charges. Percentage of Net Revenue to Capital.
Major Works. Acres Rx. Rx. Rx. Rx.
1. Godavari Delta 779,435 328,443 68,376 260,067 1,297,807 19.15
2. Kistna Delta 520,373 254,579 74.142 180,437 1,319,166 13.18
9. Periyar Project 89,143 37,526 10,751 26,775 852,914 .27
10. Rushikulya Canal 67,318 11,454 3,678 7,776 464,423 .54
Total 2,685,915 1,163,268 229,954 933,314 7,032,470 7.88
Grand Total 6.352,737 2,194,001 457,904 1,736,097
{|style="width: 75%; border-spacing: 0px;  text-align: right;" class="tablecolhdborder"
 |-style="text-align: center; border: 1px solid darkgray; border-style: none solid solid solid" 
 |colspan="2" style="width: 30%;"|Irrigation.||Area Watered. || Total Revenue. ||Total Expenditure.||Net Revenue.||Capital and Indirect Charges.||Percentage of Net Revenue to Capital.
 |-style="text-align: center;"
 |colspan="2"|''Major Works''.|| Acres|| Rx. ||Rx.||Rx.||Rx. ||
 |-
 |1.||style="text-align: left; border-style: none none none none"|Godavari Delta ||779,435|| 328,443|| 68,376|| 260,067|| 1,297,807|| 19.15
 |-
 |2.||style="text-align: left; border-style: none none none none"|Kistna Delta ||520,373|| 254,579|| 74.142|| 180,437||1,319,166|| 13.18
 |- 
 |9.||style="text-align: left; border-style: none none none none"| Periyar Project  ||89,143|| 37,526||10,751|| 26,775|| 852,914|| .27
 |-
 |10.||style="text-align: left; border-style: none none none none"| Rushikulya Canal ||67,318|| 11,454 ||3,678 ||7,776 ||464,423||.54
 |-
 | ||style="text-align: left;  border-style: none none none none"|Total ||2,685,915|| 1,163,268|| 229,954|| 933,314||7,032,470|| 7.88
 |-
 |colspan="2" style="text-align: center;"|Grand Total||6.352,737||2,194,001|| 457,904|| 1,736,097|| ||
 |}

Table with borders created cell by cell and (floatleft) edit

Foreign Exchanges.
June 14.
 Paris, cheques 25 f. 18 c.
  " Mkt. discount 2½-⅝ p.c.
*B. Ayres, 90 days 48⅛d.
* These rates are telegraphed on the day preceding their receipt.

This table is an fragment of one created to mimic a table that appears in the article "EB1911 Exchange" (volume 10, p. 54). The difference between this example and "Irrigation" (volume 14, p. 815.; see above) is that it starts with a table with no visible borders and adds borders cell by cell.

{|style="border-spacing: 0px;  text-align: center;" class="floatleft"
|+''Foreign Exchanges.''
|-
|style="border: 1px solid darkgray; border-style: solid solid solid solid;"
|style="border: 1px solid darkgray; border-style: solid solid solid solid;"|June 14.
|-
|style="text-align: left; border: 1px solid darkgray; border-style: none solid none solid"| Paris, cheques
|style="border: 1px solid darkgray; border-style: none solid none solid;"|25 f. 18 c.
|-
|style="text-align: left; border: 1px solid darkgray; border-style: none solid none solid"|  " Mkt. discount
|style="border: 1px solid darkgray; border-style: none solid none solid;"| 2½-⅝ p.c.
|-
|style="text-align: left; border: 1px solid darkgray; border-style: none solid solid solid"|*B. Ayres, 90 days
|style="border: 1px solid darkgray; border-style: none solid solid solid;"|48⅛d.
|-
|style="text-align: left;" colspan="3"|* These rates are telegraphed on the day preceding their receipt.
|}

How to place a table left, center and right edit

With a class edit

If a class is defined, for example class="tablecolhdborder", then the table by default sits on the left of the page:

 {| class="tablecolhdborder;"
  |-
  | This is a classy table it sits to the left of the page
 |}
{{green|I am text, I come after the table.}}
This is a classy table it sits to the left of the page

I am text, I come after the table.

To center the table add center to the class

 {| class="tablecolhdborder; center"
  |-
  | This is a classy table it sits in the middle of the page
 |}
{{green|I am text, I come after the table.}}
This is a classy table it sits in the middle of the page

I am text, I come after the table.

To allow the table to float to the left or the right and have the text appear to the right or the left of a table, add: ; floatleft or ; floatright to the class:

 {| class="tablecolhdborder; floatleft"
  |-
  | This is a classy left floating table
 |}
 {| class="tablecolhdborder; floatright"
  |-
  | This is a classy right floating table
 |}
{{green|I am text in the middle of the page.}}
This is a classy left floating table
This is a classy right floating table

I am text in the middle of the page.

Without class but with sytle edit

To float a table to left or right (so that text appears on the right or the left, add "floatleft;" or "floatright;" to the table class. If the table class is not defined then use style="float:left;"" or style="float:right;"

 {|style="float:left;"
  |-
  |'''This is a left floaty table'''
 |}
 {|style="float:right;"
  |-
  |'''This is a right floaty table'''
 |}
{{green|I am text in the middle of the page.}}
This is a left floaty table
This is a right floaty table

I am text in the middle of the page.

To center a table without a class use the following (see also w:HELP:TABLECENTER):

 {|style="margin-left: auto; margin-right: auto; border: none;"
  |+''Table center''
  |Table row
 |}
Table center
Table row

Page:EB1911 - Volume 26.djvu/1080 (Tobacco)

The following table, is border-less and "indicates the crops of tobacco in 1905 in the regions mentioned"

{|style="margin-left: auto; margin-right: auto; border: none;"
|-{{ts|ac}}
| || 1905.
|-{{ts|ar}}
|{{ts|al}}| North America||721,492,000 ||lb
|-{{ts|ar}}
|{{ts|al}}| South America ||108,575,000||"
|-{{ts|ar}}
|{{ts|al}}| Europe ||630,133,000||"
|-{{ts|ar}}
|{{ts|al}}| Asia||600,161,000||"
|-{{ts|ar}}
|{{ts|al}}| Africa ||23,346,000||"
|-{{ts|ar}}
|{{ts|al}}|Australia and Fiji ||1,486,000||"
|-{{ts|ar}}
|colspan="3"|Total 2,175,193,000 lb.
|}
1905.
North America 721,492,000 lb
South America 108,575,000 "
Europe 630,133,000 "
Asia 600,161,000 "
Africa 23,346,000 "
Australia and Fiji 1,486,000 "
Total 2,175,193,000 lb.