Tables
Constructing tables can get a little complicated, but simple tables aren't
much harder than lists to construct. Here's a simple table:
Tag | Attributes | What it Means |
<TABLE> |
BORDER | Draws lines around table cells |
BGCOLOR | Sets background color for table |
WIDTH | Specifies width of table |
CELLPADDING | Sets space between content and cell wall |
<TR> | None |
End of Table Row |
<TH> | COLSPAN |
Width in columns |
ROWSPAN | Height in rows |
ALIGN | Justification (left, right, center) |
<TD> |
COLSPAN | Width in columns |
BGCOLOR | Sets background color for cell |
ROWSPAN | Height in rows |
ALIGN | Justification (left, right, center) |
VALIGN | Vertical alignment of content) |
In this lesson we are keeping it very simple and so you don't have to
understand all the items included in the table shown above. It just provides
an overview of what you will see in the next several lessons.
Here's an example which is more like your assignment:
FOOD | FAT (grams) | PROTEIN (grams) | CARBOHYDRATES (grams) | CALORIES |
Pretzels | 0 | 3 |
23 | 104 |
Banana | .5 | 1 |
29 | 135 |
Orange | 0 | 1 |
21 | 88 |
Snickers Bar | 14 | 5 |
34 | 282 |
White Bread | 1 | 2 |
12 | 65 |
Study the source code for this table carefully!
ASSIGNMENT: Create a table like the one shown above.
Include a total of eight foods (none of which may be those shown on this list).
Also add a column for Vitamin C content (listed in milligrams). You
may get the necessary information from the Internet, books, or food wrappers,
BUT if challenged, you must be able to present your sources to back up the
numbers you plug into your table. BTW & FYI, protein and carbohydrates each contain
4 calories per gram and fat contains 9 calories per gram. Alcohol contains 7
calories per gram.
Try the following link: Nutrition.GOV
(see USDA Food Composition Databases)
|