The Wayback Machine - https://web.archive.org/web/20081201150951/http://www.webreference.com/html/tutorial11/1.html


spacer

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

Trials and Tabulations

A Tabled Proposal


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

Basic Table Structure

Tables have a simple basic structure. A table is defined with the TABLE element. Each table has a set of rows, and each row has several cells. They are represented using the TR and TD elements. Here's a basic table with some productivity figures from Acme Computer Corporation's Sales department:


<H3>Are Bugs Helping M.O.R.O.N.S. Sales?</H3>

<P>The table below lists the number of reported 
bugs per 1000 lines of code in M.O.R.O.N.S. against the 
product sales.</P>

<TABLE>
 <TR>
  <TD>Year</TD> <TD>Bugs</TD> <TD>Sales</TD>
 </TR>
 <TR>
  <TD>1995</TD> <TD>2.3</TD>  <TD>500,000</TD>
 </TR>
 <TR>
  <TD>1996</TD> <TD>3.2</TD>  <TD>1,700,000</TD>
 </TR>
 <TR>
  <TD>1997</TD> <TD>5.6</TD>  <TD>8,200,000</TD>
 </TR>
 <TR>
  <TD>1998</TD> <TD>12.3</TD> <TD>33,000,000</TD>
 </TR>
</TABLE>

Are Bugs Helping M.O.R.O.N.S. Sales?

The table below lists the number of reported bugs per 1000 lines of code in M.O.R.O.N.S. against the product sales.

Year Bugs Sales
1995 2.3 500,000
1996 3.2 1,700,000
1997 5.6 8,200,000
1998 12.3 33,000,000

You can see the structure of a table clearly in the above example. Of course, there are a lot of tags in there. Luckily, end-tags for the TR and TD elements are implied. So, our example can be written much more neatly with the same effect:

<TABLE>
<TR><TD>Year<TD>Bugs<TD>Sales
<TR><TD>1995<TD>2.3<TD>500,000
<TR><TD>1996<TD>3.2<TD>1,700,000
<TR><TD>1997<TD>5.6<TD>8,200,000
<TR><TD>1998<TD>12.3<TD>33,000,000
</TABLE>

That's the good news. The bad news is that you shouldn't do this. The reason you can't is that there's a bug in Navigator that makes the browser mess up most of the CSS styles in your entire document if you don't include each and every tag in the elements of a table. I've already mentioned that omitting end-tags is the number 1 trigger of CSS bugs. The precise effects of this are not predictable, and depend on your document as well as the precise CSS properties you've set. Omitted table tags are actually the first thing you should check for when something goes wrong in CSS, especially when it comes to the visual formatting model.

Tables and CSS

This brings us to the sticky point about tables. HTML tables have been around a lot longer than CSS, so a lot of their formatting can be controlled using older, HTML-based methods instead of CSS. Also, the formatting of tables can be a tricky business, as we'll see later on. Level 1 of CSS didn't give any methods for controlling the visual presentation of tables. CSS2 has quite a comprehensive set of methods, but the problem is that they are still mostly unimplemented. Discussing them here would be like discussing the problems in the administration of colonies in neighboring star systems. Though I hope browsers supporting CSS table properties appear before practical inter-stellar travel becomes a possibility, we'll make an exception from our normal way of doing things and take a more practical stand-point, exploring some of the methods used for table presentation today.

Of what we have explored so far of CSS, some things still apply. Background colors can be set in tables, cells, rows and, as we will see later, columns. CSS properties can be set for elements inside cells and things can be expected to work pretty well, as long as you steer clear of box and layout properties for the table cells themselves. Another bug concerning tables and CSS, however, is that most CSS properties will not be inherited by tables from their parents, nor will they be inherited by rows and cells, in both Explorer and Navigator. It is good practice to set CSS properties explicitly for table elements, to make sure they are applied.

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
Crucial Triples Up With New Three-Channel DDR3 Kits · Meet the Finalists: Excellence in Technology Awards · Tealeaf Offers Insight to Mobile Customer Behavior

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

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