ALS 3203 - Lesson 6
Glossary - Tables and Colors
© P. M. Choate 2007
Additional Web site dealing with HTML Tables:
Note: In the following examples the <html>, <head>, <title>, and <body> starting and ending tags have been left out to save space. To actually see the examples as written here you would have to include these omitted tags in your file to have a complete HTML.
- &
nbsp;
- Creates a hard-coded space, used to expand table cells (by creating spaces) or to place a non-displaying character in a table cell, thus creating an empty cell. A table cell cannot be truly empty (lacking any html tags) or it will not be displayed. Example: To produce the following table - use this HTML;
<table border><tr><td bgcolor="#0000ff">&
nbsp;</td><td>Hello There!</td></tr></table>
If we leave out the bgcolor="#0000ff" and the &
nbsp; and add a third cell with nothing in it, the result will be: <table border><tr><td></td><td>Hello There!</td><td></td></tr></table>
If we want to get a little fancier, add some color to create a picture frame effect like this: <table border><tr><td bgcolor="#ff0000"></td><td>Hello There!</td><td bgcolor="#ff0000"></td></tr></table>
Remove the border attribute from the table tag, add bgcolor="#ede49e" (Pale Goldenrod) to the cell with text, and you get-
<table><tr><td bgcolor="#ff0000"></td><td bgcolor="#ede49e">Hello There!</td><td bgcolor="#ff0000"></td></tr></table>
So, with only a few HTML tags and a vivid imagination you can create many different effects using table cells, borders, colors, and spaces!
- <body bgcolor="#RRGGBB">
- Sets the background color for entire web page. Replace the RRGGBB with hex code for actual color just as you did for table cells.
- <body background="mydog.gif">
- Sets a background image for a web page. The image will be tiled (copied) as many times as necessary to fill the browser window.
- <caption>
- Creates a caption at top of table or at bottom. Must follow the opening table tag. Requires a </caption> tag.
<table border><caption>"Test Caption"</caption><tr><td>A one-cell table</td></tr></table> produces
"Test Caption"
| A one-cell table |
- col span="some number"
- Merges table cells across columns.
<table border>
<tr><td>Cell 1</td><td>Cell 2</td><td>Cell 3</td></tr>
<td colspan="2">Cell 4</td><td>Cell 5</td></tr>
</table> produces
| Cell 1 |
Cell 2 |
Cell 3 |
Cell 4 |
Cell 5 |
- hexadecimal code
- Six character alpha-numeric code for colors in HTML. Examples are:
- black - #000000 (these are zero's)
- white - #ffffff
- Some sites dealing with colors and HTML codes
- row span="some number"
- Merges table cells vertically across rows.
| Cells 1 and 4 |
Cell 2 |
Cell 3 |
| Cell 5 |
Cell 6 |
- <table>
- HTML tag to start the definition of a table. Many attributes can be included in this tag, including bgcolor, width, border size, cell spacing, cell padding. Requires an </table> tag.
- <td>
- HTML tag to start the definition of a table cell. Requires an </td> for each cell.
- <th>
- HTML tag for a column header in a table, used for the first row only!
- <tr>
- HTML tag to start a table row, requires an ending tag of </tr>
- valign="Top, middle, bottom, or baseline"
- HTML tag for the vertical alignment of image or text in table cell. Values are "top", "middle", "bottom", or "baseline".
Today is:
| ©P. M. Choate 2007
|