In our fourth lesson we are learning how to create tables. This looks like it will be an exciting and very useful lesson. I'm anxious to get started!
This is an example of a very simple table.
| Math | English |
| Science | History |
Using the same data I created a table with a border. It looks much better than the first table.
| Math | English |
| Science | History |
Now I'm centering my table and adding other tags and attributes, such as summary, caption and table header.
| Name | Age | Gender | Relationship |
|---|---|---|---|
| George | 56 | M | Husband |
| Amy | 34 | F | Daughter |
| Brett | 31 | M | Son |
Using my original table I will now add the colspan attribute to create a heading that spans more than one column. In this case the heading is "Important Classes" with a colspan of 2.  Notice that the heading stretches across the table.
| Important Classes | |
|---|---|
| Math | English |
| Science | History |
I can also opt to use the rowspan attribute that creates a heading that covers more than one row, stretching down the table instead.
| Important Classes | |
|---|---|
| Math | English |
| Science | History |
I may decide that my table needs more space. For this I can use cellspacing (to make the space between the cells larger).
| Important Classes | |
| Math | English |
| Science | History |
. . . or cellpadding (to make the space between the items in the cells and the cell walls larger).
| Important Classes | |
| Math | English |
| Science | History |
In the following table I have tried to use most of the attributes we've discussed for tables thus far:
| Important Classes | |
|---|---|
| Taught in School | |
| Math | English |
| Science | History |
Now let's add some color.
| Name | Age | Gender | Relationship |
|---|---|---|---|
| George | 56 | M | Husband |
| Amy | 34 | F | Daughter |
| Brett | 31 | M | Son |
| Important Classes | |
| Math | English |
| Science | History |
One tag that is not used too often is called a preformatted tag. In this tag, text will appear on the page as it appeared in the original document. This would be especially good for a poem. You can change the style and size of the font. For this example I have chosen to use the piece of poetry that was included with the lesson in hopes that there are no copyright issues.
I daydreamed night dreams and they all seemed so real. then I fantasized fantasies and realized they were reality!
These two tags are used to make the text between the tags either "bigger" or "smaller" than the rest of text. You would probably use the font attributes more often but this is another option.