The Wayback Machine - https://web.archive.org/web/20081201053027/http://www.webreference.com:80/html/tutorial11/8.html


spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

Trials and Tabulations

Setting the Table


Developer News
Mandrake Linux Founder Back, Virtually
Amazon: We're a Technology Company
Sun Expands MySQL With Closed Source

Page Layout Using Tables

The first thing people realized when they saw tables is that tables can be used to split the display into rectangular boxes in any layout. Through intelligent use of the ROWSPAN and COLSPAN attributes, cells can have any layout you want. Back before CSS appeared on the scene, this was an incredibly powerful way to lay out pages that until then were forced to have a normal flow.

I don't have to tell you why this is bad. Making a document that is included in a table when its contents are not data that has to be tabulated is bad because you just throw document semantics out the window. Also, we have seen that in Navigator, complicated tables and complicated CSS are mutually exclusive unless you are prepared to be amazed at what bugs can creep into a popular, release-version software product by a respectable company. Although these problems are clearly bugs in the traditional sense of the word, if you're going to create a Web page that you wish to be available to millions of people, a good chunk of which will be using Navigator, you just have to do things Netscape's way.

Some simple rules to follow when designing layouts using tables:

  1. Use only TABLE, TR and TD elements. Mess with any of the other ones and Navigator is bound to crash sooner or later. Anyway, the semantics of the rest of the elements are more or less incompatible with table-based layout.
  2. Make sure that if you remove all of the table-related tags from your document, the structure makes sense. This is good for several reasons: One, there is a sound document structure if the document is looked at from top to bottom. Two, older browsers that don't understand tables (or newer ones like lynx, a text-based browser that still doesn't do tables) will ignore these tags anyway, so your document structure will be meaningful to them. The best way to do this is to design your document as a linear document first, and then add the table elements around this to lay it out in an interesting way. This process is similar to designing a document in HTML and then designing a style sheet to apply to it.
  3. Avoid CSS layout directives at all costs. If you see something go wrong, this is the first thing to check. CSS visual formatting model properties do not co-exist peacefully with tables.

Now all you have to do is create a table around the section of your document that you wish to lay out, and put sections of the document in different cells. Arrange these cells as you wish by putting them on different rows and setting their row span, column span and width, and hey presto! You just made a crude layout.

This method is not preferred but it is widely used, and for a good reason: It's the only reliable way to lay out an HTML document. You'll find it on many pages, including WebReference.com's front page. You will probably have to use it for pages that need a layout to keep a lot of information in the same part of the screen and will be accessed by many people. Just don't overdo it. If your page could really benefit from a layout, use this method. Otherwise, stick with normal document flow. Most of the time, it makes more sense to the reader as well as being the right way to do things.

Front Page123456789

Produced by Stephanos Piperoglou

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Copyright 2008 Jupitermedia Corporation All Rights Reserved.

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A; with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
The Geek Wishlist - Ten Tech Toys for the Holidays · Cool Tool for Asterisk Developers · Wi-Fi We Can Be Thankful For

URL: http://www.webreference.com/html/tutorial11/8.html
Created: Feb 10, 1998
Revised: Feb 16, 1999

Morty Proxy This is a proxified and sanitized view of the page, visit original site.