This site designed with Web Page Creator 32 HTML Editor ver. 6.0 |
Introduction |
Backgrounds |
Fonts and Text |
Accents |
Lists |
Images |
Links |
Tables |
Frames |
Forms |
JavaScript |
Great Books |
Members Area |
I put the "Tables" section toward the end of this tutorial because they are rather complex to understand at first, they take longer to work with, but tables are the most versatile and useful of all these HTML tags.
There are many tags and variable attributes that you can use within the "<TABLE>" & "</TABLE>" tags. But first, a quick run down of just the basics. (Inside a TABLE.
This exmple is the minimum requirements for your table to work. It shows a simple Table with one Table Row, and one Table Data cell that is presently empty.
Fire up that old text editor and create your first table page something like this: <HTML>
<BODY BGCOLOR=#000000>
<TABLE>
</BODY>
Other useful things to know about Tables:
Start with the standard document requirements, and include the "Table" Tags. <HTML>
<TABLE>
</TABLE> </BODY>
Now let's create some columns and rows inside the table. <HTML>
<TABLE> <TR><TD>1-A</TD><TD>1-B</TD><TD>1-C</TD><TD>1-D</TD></TR>
<TR><TD>2-A</TD><TD>2-B</TD><TD>2-C</TD><TD>2-D</TD></TR>
<TR><TD>3-A</TD><TD>3-B</TD><TD>3-C</TD><TD>3-D</TD></TR>
<TR><TD>4-A</TD><TD>4-B</TD><TD>4-C</TD><TD>4-D</TD></TR>
</TABLE>
</BODY>
Notice when you view it that you see only the series of numbers and letters. Now add a "BORDER" to your table.
<HTML>
<TABLE <TR><TD>1-A</TD><TD>1-B</TD><TD>1-C</TD><TD>1-D</TD></TR>
<TR><TD>2-A</TD><TD>2-B</TD><TD>2-C</TD><TD>2-D</TD></TR>
<TR><TD>3-A</TD><TD>3-B</TD><TD>3-C</TD><TD>3-D</TD></TR>
<TR><TD>4-A</TD><TD>4-B</TD><TD>4-C</TD><TD>4-D</TD></TR>
</TABLE>
</BODY>
View this and you'll see an entirely different effect.
You can add Headings to each column by simply including this little snippet of code:
<HTML>
<TABLE BORDER="1"> <TR><TH>A</TH><TH>B</TH><TH>C</TH><TH>D</TH></TR>
<TR><TD>1-A</TD><TD>1-B</TD><TD>1-C</TD><TD>1-D</TD></TR>
<TR><TD>2-A</TD><TD>2-B</TD><TD>2-C</TD><TD>2-D</TD></TR>
<TR><TD>3-A</TD><TD>3-B</TD><TD>3-C</TD><TD>3-D</TD></TR>
<TR><TD>4-A</TD><TD>4-B</TD><TD>4-C</TD><TD>4-D</TD></TR>
</TABLE>
</BODY>
OK, now you're beginning to cook with fire. Let's go in a little deeper now.
You can further manipulate the appearance of your tables with a few more neat little options.
<HTML>
<TABLE BORDER="1" <TR><TH>A</TH><TH>B</TH><TH>C</TH><TH>D</TH></TR>
<TR><TD>1-A</TD><TD>1-B</TD><TD>1-C</TD><TD>1-D</TD></TR>
<TR><TD>2-A</TD><TD>2-B</TD><TD>2-C</TD><TD>2-D</TD></TR>
<TR><TD>3-A</TD><TD>3-B</TD><TD>3-C</TD><TD>3-D</TD></TR>
<TR><TD>4-A</TD><TD>4-B</TD><TD>4-C</TD><TD>4-D</TD></TR>
</TABLE>
</BODY>
Now add a "CAPTION" to your table to cue in the world to what it's all about.
<HTML>
<TABLE BORDER="1" CELLSPACING="5" CELLPADDING="5"> <CAPTION>My Table is Growing Fast</CAPTION> <TR><TH>A</TH><TH>B</TH><TH>C</TH><TH>D</TH></TR>
<TR><TD>1-A</TD><TD>1-B</TD><TD>1-C</TD><TD>1-D</TD></TR>
<TR><TD>2-A</TD><TD>2-B</TD><TD>2-C</TD><TD>2-D</TD></TR>
<TR><TD>3-A</TD><TD>3-B</TD><TD>3-C</TD><TD>3-D</TD></TR>
<TR><TD>4-A</TD><TD>4-B</TD><TD>4-C</TD><TD>4-D</TD></TR>
</TABLE>
</BODY>
Now let's "center" the table and define it's width. You can easily define the width and height of your tables to manipulate the screen appearance like so:
<HTML>
<TABLE BORDER="1" CELLSPACING="5" CELLPADDING="5" <CAPTION>My Table is Growing Fast</CAPTION>
<TR><TH>A</TH><TH>B</TH><TH>C</TH><TH>D</TH></TR>
<TR><TD>1-A</TD><TD>1-B</TD><TD>1-C</TD><TD>1-D</TD></TR>
<TR><TD>2-A</TD><TD>2-B</TD><TD>2-C</TD><TD>2-D</TD></TR>
<TR><TD>3-A</TD><TD>3-B</TD><TD>3-C</TD><TD>3-D</TD></TR>
<TR><TD>4-A</TD><TD>4-B</TD><TD>4-C</TD><TD>4-D</TD></TR>
</TABLE>
</BODY>
We be Smokin' Now! OK, now add some "Row Headings".
<HTML>
<CENTER>
<TABLE BORDER="1" CELLSPACING="5" CELLPADDING="5" WIDTH="75%">
<CAPTION>My Table is Growing Fast</CAPTION>
<TR><TH>A</TH><TH>B</TH><TH>C</TH><TH>D</TH></TR>
</TABLE>
</CENTER>
</BODY>
View it.
There are times when you may want to align the data in the headings or the table data cells to the left or right in order to accomplish certain desired effects. Let's align the row headings to the right just so you can see the example of how it works.
<HTML>
<CENTER>
<TABLE BORDER="1" CELLSPACING="5" CELLPADDING="5" WIDTH="75%">
<CAPTION>My Table is Growing Fast</CAPTION>
<TR><TH>A</TH><TH>B</TH><TH>C</TH><TH>D</TH></TR>
<TH <TH <TH <TH </TABLE>
</CENTER>
</BODY>
You can use the ALIGN="LEFT", CENTER, or RIGHT to align any Row or Column Headings or the content of any Table Data Cell. Use them however you see fit. Use your imagination.
You can also specify the width of each column by just adding the "WIDTH" attribute to the top cell of the column and the entire column will follow that lead. Width can be expressed in % or in # of pixels. For example, insert this code into your Column Headings on your fast growing table:
Insert an Image into your table data cell like so: <TR><TD> It's just as simple and easy as that!
You can also span rows or columns with any data cell, you need only use the "COLSPAN" or the "ROWSPAN" attributes in the <TD> tag. If you want your top row to span the width of the entire table simply tell it to. Add the following lines to your "Fast Growing Table" as the very first Table Row (<TR>).
<TR><TD COLSPAN=5>Spanning the columns!</TD></TR>
Use the "Rowspan attribute the same way to span as many of your table rows as you desire.
Some other notes on TABLES:
Change the background colors of each table row or each individual table data cell, column, or row. Although be aware that in older versions of both Netscape Navigator and Microsoft Internet Explorer, this will not work.
<TR><TD BGCOLOR="red"><FONT COLOR="black">Text data in table data cell</FONT></TD></TR>
Use the color codes, color names, declare the background color or image for each individual cell, by rows, by columns, however you want it!
When it comes to versatility, you just cannot beat tables. And you cannot practice using them enough either. the more you use them, the more tricks you'll learn for newer ways to use them. You can use the "BORDER attribute to create a frame for the photo of your happy smiling face on your homepage! Now go practice!
<TABLE> - Begins the Table
<TR> - Begins the first Table Row
<TD> - Begins the cell containing the Table Data
</TD> - Ends the cell containing the Table Data
</TR> - Ends the first Table Row
</TABLE> - Ends the Table
<HEAD>
<TITLE>My First Table Page</TITLE></HEAD>
<H1>My First Table Page</H1>
<TR>
<TD><FONT SIZE=3 COLOR=#FF0000 FACE="Arial">This is my text in a Table Data Cell</TD>
<TD><FONT SIZE=3 COLOR=#00FF00 FACE="Arial">This is my text in my second Table Data cell</TD>
</TR>
</TABLE>
</HTML>
<HEAD>
<TITLE>My First Table</TITLE></HEAD>
<BODY BGCOLOR=#00EEEE>
</HTML>
<HEAD>
<TITLE>My First Table</TITLE></HEAD>
<BODY BGCOLOR=#00EEEE>
</HTML>
<HEAD>
<TITLE>My First Table</TITLE></HEAD>
<BODY BGCOLOR=#00EEEE>
</HTML>
<HEAD>
<TITLE>My First Table</TITLE></HEAD>
<BODY BGCOLOR=#00EEEE>
</HTML>
Add Spacing and Padding to your table data cells.
<HEAD>
<TITLE>My First Table</TITLE></HEAD>
<BODY BGCOLOR=#00EEEE>
</HTML>
<HEAD>
<TITLE>My First Table</TITLE></HEAD>
<BODY BGCOLOR=#00EEEE>
</HTML>
<HEAD>
<TITLE>My First Table</TITLE></HEAD>
<BODY BGCOLOR=#00EEEE>
</HTML>
<HEAD>
<TITLE>My First Table</TITLE></HEAD>
<BODY BGCOLOR=#00EEEE>
</HTML>
<HEAD>
<TITLE>My First Table</TITLE></HEAD>
<BODY BGCOLOR=#00EEEE>
</HTML>
<TH WIDTH="20%" > A</TH>
<TH WIDTH="20%" > B</TH>
<TH WIDTH="20%" > C</TH>
<TH WIDTH="20%" > D</TH>
</TR>
Images /
Links /
Frames /
Forms /
JavaScript
Cool Free Web Stuff /
Recommended Books /
Web Site Design /
WilRose.com Home