Chapter 2. Creating Tables

In This Chapter

The basic building blocks for tables

Some table tags and attributes you might want to try

Designing tables in Visual Web Developer Express

Some alternatives to using tables for page layout

Using tables for page layout anyway

You can use tables as a great way to present columns of data, all neatly aligned. Accountants love tables because all those little cubbyholes for information appeal to a number cruncher’s sense of order.

Web designers love tables, too, but perhaps for the wrong reasons. For years, designers have used tables to create the page layout because columns, rows, and cells work great for holding text and graphics in one spot.

Tsk, tsk, and shame on them. The World Wide Web Consortium’s (W3C) advice about tables has been honored mainly in the breach: “Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media,” says the W3C. “Authors should use style sheets to control layout rather than tables.” (You can read about how to use style sheets for layout in Book 3, Chapter 4.)

Despite the W3C’s scolding, people continue to use tables to align content. So you can find a discussion of the technique near the end of this chapter. However, most of this chapter concentrates on the <table> tag’s forte — the presentation of organized, tabular data in rows and columns. A wellformatted grid has a pleasing structure that makes finding what you’re after on a Web page easy. ...

Get ASP.NET 2.0 All-In-One Desk Reference For Dummies® now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.