untitled

(John Hannent) #1

Chapter 12


Handling Tables and Lists


(And Doing Away with Tables)


In This Chapter


Choosing the right list style


Binding lists to other elements


Displaying tables with CSS


Avoiding using tables for layout


Creating free-form designs without tables


A


h, now I come to the classics. The venerable backbone of classic
HTML — tables. What would Web designers ever do without tables?
They’ve been to traditional Web page layout what frames are to houses or what
chicken wire is to a parade float: It’s what you attach everything else to.

In theory, you’re supposed to be able to create vibrant, complex Web page
designs without using tables at all, thanks to CSS. In practice, most of today’s
Web pages are still — behind the curtain — held together by tables. Think
I’m toying with you? Go to almost any well-known site like http://www.cnn.comor
http://www.bbc.com, choose View➪Source in Internet Explorer to see the HTML,
and I’ll bet you don’t have too look far to find your first <table>element.
You won’t have to look much further to find dozens more.

In this chapter, you see what impact CSS has had on HTML lists, and then go
on to explore how CSS can either embrace tables, or, perhaps, somehow, even
replace them altogether.

This chapter has two focal points. First, it explores what CSS contributes in
the way of special properties for lists and tables. (The answer, for you impa-
tient types, is, “Not much.”) Second, you see how you can free your Web pages
from dependency on tables for their structure and layout. This — the CSS
positioning features — is a big contribution that CSS has made to Web page
design and one that, sooner rather than later, all Web page designers should
embrace. The CSS positioning features are just a much more sensible way of
doing things than using those old, cumbersome table techniques.
Free download pdf