Tables in general are used for Web page layout very frequently, and will continue to be used until element positioning with Cascading Style Sheets (CSS) is better supported by the browsers.
Nested tables are used to achieve finer control over layout and positioning. What are nested tables? Tables inside of other tables.
The diagram at right illustrates the concept of nesting tables. Each colored box represents a different table; four are shown here.
In theory, you can put an unlimited number of tables inside tables inside tables... In practice, browsers run out of memory and lose track of the details of tables, so the practical limit is three or four nested tables.
Advantages and Disadvantages
Given that nested tables are used so widely for layout, you'd probably guess that the advantages outweigh the disadvantages - and of course you'd be right!
So let's look at the advantages first:
Of course, there are always disadvantages:
Below you'll find a list of Websites to look at. Go to each one and examine the HTML code (for the home page only), using your browser's View > Source or View > Page Source menu commands. Hint: Use the Search feature to look for table.
Answer these questions for each one:
- Does the page have one, or more than one table for page layout?
- Are there tables nested inside each other, and if so, how deeply?
- How many columns are set up in each table?
- What visual techniques are used to make different areas of the page look separate? (Borders? Images? Colors? Empty space?)
- What are the different page areas used for?
Websites to Examine:
- The Italian Futurist Book: http://www.colophon.com/gallery/futurism/index.html
- Aero Tec Laboratories: http://www.atlinc.com/fuelcell.htm
- Ann Arbor District Library: http://www.aadl.org/
- Java 3-D API: http://java.sun.com/products/java-media/3D/
- Wargame.com: http://www.wargame.com/
- Exotic Pet Vet Net: http://www.exoticpetvet.net/
- Kids Gardening: http://www.kidsgardening.com/
- Say Hello to the World: http://www.ipl.org/div/kidspace/hello/
- CNN: http://www.cnn.com/
- Daily Funnies: http://www.comedy-zone.net/cartoons/funnies.htm
- Secrets of the Ice: http://www.secretsoftheice.org/explore/index.html
- Russian Space Web (may need to open in WordPad rather than Notepad): http://www.russianspaceweb.com/
- PC World: http://www.pcworld.com/reviews/top100/index/0,00.asp
- Juneteenth World Wide Celebration: http://www.juneteenth.com/
- International Korfball Federation: http://www.ikf.org/
Audience: This
is for people who know about creating HTML tables, and want to explore the ways
tables are used for page layout.
Objectives: When you successfully complete this lesson,
you will be able to...
About this document...
Module W24d: This document is part
of a modular instruction series in computer technology. For more information,
see the overview
or the list of modules in this series, W: World Wide Web. This document has
been used in the following classes: INP 150.