|
|
The first tag you start your table with, is the <TABLE> tag. Within this tag are various elements you can use, such as:
This table was started with a TABLE tag that looks like this: <TABLE WIDTH=600> |
You will see that the table is 600 pixels wide. |
This table was started with a TABLE tag that looks like this: <TABLE HEIGHT=100> |
You will see that the table is 25 pixels high. |
This table was started with a TABLE tag that looks like this: <TABLE BORDER=5> |
This table was started with a TABLE tag that looks like this: <TABLE CELLPADDING=10> |
The CELLPADDING is the space between the border of the cell and the cells contents. |
This table was started with a TABLE tag that looks like this: <TABLE CELLSPACING=5> |
The CELLSPACING is the distance apart each cell is from the other. |
This table was started with a TABLE tag that looks like this: <TABLE BGCOLOR="#FFFFFF"> |
The background of this table is white. |
This table was started with a TABLE tag that looks like this: <TABLE VALIGN=TOP> |
This table is vertically aligned to the top. |
This table was started with a TABLE tag that looks like this: <TABLE ALIGN=RIGHT> |
This table is aligned to the right of the page. |
How about
a heading to your table? To do this you will use the <TH></TH> tags.
Here is an example
of a table with a heading.
This is an example of a table heading. |
---|
Table headings are a good thing to use, so that people will understand more what you have listed in the table. |
Go ahead, try it!!! You will see it's not so difficult.
Flowers | Hearts | |
Pictures | Candy | Soda |
<TABLE BGCOLOR="#CCCC99" BORDER=5>
<TR>
<TD COLSPAN=2>Flowers</TD>
<TD>Hearts</TD>
</TR>
<TR>
<TD>Pictures</TD>
<TD>Candy</TD>
<TD>Soda</TD>
</TR>
</TABLE>
Now let's do a ROWSPAN
so you can see what that looks like.
Flowers | Hearts | Pictures |
Candy | Soda |
<TABLE BGCOLOR="#CCCC99" BORDER=5>
<TR>
<TD ROWSPAN=2>Flowers</TD>
<TD>Hearts</TD>
<TD>Pictures</TD>
</TR>
<TR>
<TD>Candy</TD>
<TD>Soda</TD>
</TR>
</TABLE>
How about putting a graphic in a table? Let's try it!!!
We just put this computer graphic in a table. |
Now the
<CAPTION> tag. This tag is used if you would like a comment over your table to let people know what the intentions of the
table may be.
This is the <TH> tag, used as a table heading. End this tag when you end your heading like this: </TH> |
---|
This is a <TR> with the <TD> to show what is in this data section. End the tag with </TD> then end the <TR> with the </TR> tag. |
This is another row of table data, you may use as many rows as you choose to. |
When you first start to learn tables they can seem rather confusing. There are so many attributes to the <TABLE></TABLE> and <TD></TD> tags, but once you work with them, you will become well accustomed to them, and will find they are an asset to a well designed web page. You can put TABLES within tables, to space a page of graphics and text out very nicely, and neatly. Think of a TABLE as a large piece of paper, and how you want things drawn on it. For each item, you can make it's own table within one big table. The one thing you MUST remember, ALWAYS close each and every table tag you use, or your table will not work right. You can, and probably will in the future, design your entire web site in TABLES. Work with all the tags and attributes you have learned here, and see how they all work to your advantage. Then, put them to work on your web pages and watch how it makes your pages much neater and cleaner looking! Don't be afraid to use them, the more you work with them, the easier it becomes. And please, feel free to e-mail us with any comments or help you may need. Have FUN!!! That is the best part of web page design, the fun of watching your pages come to life!!!! |
[ E-Mail Us ]