Your Basic Table Stucture looks like this:
CELL1 | CELL2 | CELL3 |
---|---|---|
CELL4 | CELL5 | CELL5 |
<Table border>
<caption> Basic Table Structure </caption>
<TR> <TH> CELL1 </TH> <TH>CELL2 </TH><TH>CELL3</TH></TR>
<TR> <TD> CELL4 </TD> <TD>CELL5</TD> <TD>CELL5</TD> </TRr>
</Table>
You'll notice that there are two basic cell elements, the <TH> tag and the <TD> tag. The <TH> tag , table header, will be bold text and centered. The <TD> tag, table definition or table data, usually contains your content, and this is not bold text and default aligned left. Of course, you can apply any type of text formatting tag within the the cell elements. The <CAPTION> tag allows you to place a caption above or below your table.
The <TABLE> tag itself can contain many attributes: BORDER=, HEIGHT=, WIDTH=, BGCOLOR=, CELLPADDING=, CELLSPACING=, ALIGN=and VALIGN=.
CELL1 | CELL2 | CELL3 |
---|---|---|
CELL4 | CELL5 | CELL5 |
Many of these attributes can be used to modify or control the appearance of indivdual cells or an entire row. In the table below varied alignments and colors are affected through using some of these attributes in the <TR>, <TH> or <TD> tags:
DOMINANT HEADER | OTHER HEADER |
---|---|
BLUE | RED |
YELLOW | BLACK |
Now it starts to get more interesting. If you'll notice there is no border. That's because I didn't put a border attribute in the <TABLE> tag. By using the WIDTH=75% attribute in the <TH> tag I made the cell on the left longer. The height and width attributes can be specified in a % of the browser window or as the number of pixels. Giving BGCOLOR= a different value in each of the cell tags gives us the different background colors. (logical?)
3 Column Header | 2 Column Header | |||
---|---|---|---|---|
normal cell | normal cell | normal cell | normal cell | normal cell |
Row span of 3 | Colspan of 4 | |||
normal cell | Colspan is 3 Rowspan is 2 | |||
normal cell |
Tables have many combinations and permutations (possibilities). With tables you can have multicolumn text pages with graphics interspersed. The example below has a graphic in its own table which allows me to put a little frame around the portrait of Kant. This is simply a table with one row and two cells. Yet it creates a table (page?) that is familiar and pleasing to the eye.
In order to finish this example of page layout using the < TABLE> tag, I will continue entering text as though I had some gloriously illuminating theory I wanted to communicate to this esteemed group. Of course, this is far from the truth of the matter; I am only continuing to try to fill Cyberspace with more useless HTML tutorials. I hope this example of a two column page with a "nested table" looks as good as I imagined it should. I loaded the table into the browser and realized I still hadn't babbled quite long enough to fill this cell of the table. With this valueable knowledge in hand, I returned to my handy HTML editor to add a little more text. I have used text here to fill out the cell. |
---|
I could k