Lesson 15: Tables

This is almost the same as the previous table. The page is structured differently. It is split into two halves, each occupying 50% of the page width. This is accomplished with the HTML <div>... </div> element. Two sections are placed into the main div element, each with a width of 50%. The first has to be told to "float left". The second will automatically be placed to the right of the first. The text is placed in the left section and the table is placed in the right section. The structure looks like this:

<div style="width:100%">

<div style="width:50%; float:left">

text here

</div>

<div style="width:50%">

table here

</div>

</div>

Below you see the effects of this structure. The table is created exactly the same as in the previous lesson, except that it is missing the cell that spanned the five rows.

The table at the right contains data taken from a Wikipedia article containing the populations of countries around the world. The list includes independent countries and inhabited dependent territories based on the ISO standard ISO 3166-1. The current population of the world is 6,826,500,000, according to that article.

Figures used in the table are based on the most recent estimate or projection by the national census authority where available and usually rounded off. Where national data is unavailable, figures are based on the July 1, 2009 estimate by the Population Division of the United Nations Department of Economic and Social Affairs.

Country Population Estimate
People's Republic of China 1,337,960,000
India 1,181,854,000
United States 309,449,000
Indonesia 231,369,500