However, not only does this result in invalid
XHTML, but some browsers won??™t render tables accurately (or at all) when end tags
are omitted. Furthermore, there??™s evidence to suggest some search engines can??™t
properly spider pages that contain broken tables.
TABLES: HOW NATURE (AND THE W3C) INTENDED
235
6
the cells and the table??™s edges. (The CSS property border-spacing is intended to do the
same thing as cellspacing, but Internet Explorer to version 7 doesn??™t support it.)
| Cell one | Cell two |
| Cell three | Cell four |
You might be thinking that design-wise, this example sucks, and you??™d be right. The chunko-
vision 3D border isn??™t particularly tasteful. However, you can omit the border attribute
and use CSS to style borders instead??”see the ???Styling a table??? section later on in this
chapter. That section also details how to set padding in CSS, which provides you with sitewide
control over cell padding. CSS also gives you much finer control over the individual
elements in a table??”whereas the inline HTML attributes impose a one-style-fits-all
straightjacket.
Spanning rows and cells
It??™s sometimes necessary for data to span multiple rows or columns. This is achieved via
the rowspan and colspan attributes, respectively. In the following table, the first row has
three cells. However, in the second row, the first cell spans two rows and the second cell
spans two columns.
Pages:
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330