tables and more lists
you are here
The new and improved table
Make the changes to the table
in “journal.html” and give it a test
run. Take a look at the table. Think
about exactly what you’re doing to
the table: you’re using XHTML to
specify that certain cells should take
up more than one row, and to do
that, you’re removing the
Now we’ve got a great-looking
table that doesn’t have any
redundant information in it.
You said you can have table data
span columns too?
You sure can. Just add a colspan
attribute to your <td> element and specify
the number of columns. Unlike the rowspan,
when you span columns, you remove table
data elements that are in the
(since you are spanning columns, not rows).
Can I have a colspan and
rowspan in the same <td>?
You sure can. Just make sure
you adjust the other <td>s in the table to
account for both the row and column spans.
In other words, you’ll need to remove the
corresponding number of <td>s from the
from the column.
Do you really think these
rowspans look better?
Well they certainly reduce the
amount of information in the table, which is
usually a good thing. And, if you look at a
few tables out there in the real world you’ll
ﬁnd that rowspans and colspans are quite
common, so it’s great to be able to do them
in XHTML. But if you liked the table better
before, feel free to change your XHTML and
go back to the previous version.