How to Build a Website
Tables Setting
by Craig Walker

Now it's starting to get fun. Don't you think so?

On this page we will add a half a dozen photos and build a table to control them.

First things first, as they say. Create a new directory called funpage in your buildweb directory. That should be the second subdirectory in the buildweb directory, the other being pictures.

Now copy the 7 pictures below to the funpage directory by right clicking on each picture and then "Save As" to the funpage folder. The really light image of the bike rider will be used as the page background.

These pictures look smaller here than they will on your page. I have set the viewing size to be smaller for each image on this page. You can do that by specifying a HEIGHT= or WIDTH= option after the filename in the IMG SRC tag. That is not something you would normally want to do though. For more information on managing graphics, see the Graphics Guide.

This is going to be a lot of code to copy. When adding the images, you will notice that all the data cells contain the exact same data, except for the very last number in the filename. To make it easier on yourself, type the TR tag, then the first IMG SRC tag, surrounded by the TD tags. Next, copy the TD & IMG SRC tags and paste them on the next line. Type the closing TR tag. Now copy the whole table row code including the TR, TD, & IMG SRC tags, and paste it two times on the page. Close the table and then all you have to do is change the very last number in the filenames. The numbers should be 1 to 6.

If you see patterns, you can save yourself a lot of work. The F - U - N word in the title is a lot of code. Each letter was formatted individually, once you have typed one FONT tag you can copy and paste it in front of each letter & dash. Type the F - U - N first, then add the tags. All you have to do is change the color. Then type, copy, & paste the closing FONT tag after each letter and dash. The F - U - N code is repeated in the last row of the table too. Copy the whole word w/tags and paste it at the end of the sentence. Then just change the SIZE number in all the tags from 7 to 4, done.

If you think I type all this stuff, you're nuts. It's a lot of work but the art of cloning code is a real time saver. Learn how that works and you will be fine.

I think you will really enjoy this page. Pictures are a lot of fun. Page continuity is important to me. Even though I changed the background on this page, I tied it to the previous pages by using the green background color in the title and pictures tables. It works for me. I also like to use colored text. Nothing wild, but even the dark blue on this page makes a happier page to read than black and white. That's my opinion.

Are you ready? Save your favlinks.htm file. Then Save As funpage.htm and delete everything after the BODY tag, down to the HR tag at the bottom of the page. Now, got your fingers warmed up?

You know that at any time you can look at your page to see the progress. After you get to the first closing center tag, </CENTER>, take a look. I think you'll like it. Of course, at any time you can go to the bottom of the code section and view the page I built, and see where all this is going.

Be sure to mind all the spaces, especially those that aren't as obvious like the dashes in the F - U - N code.

The new code is BOLD

Click Here to see the page
<HTML>

<HEAD>
<TITLE> F-U-N Page </TITLE>
</HEAD>

<BODY BACKGROUND="funpage/funpage_07.jpg" TEXT="#000066">

<CENTER>

<TABLE BORDER=5 BGCOLOR="#33ffcc" WIDTH=75%>

<TR>
<TD ALIGN=MIDDLE>

<B>
<FONT FACE=ARIAL,HELVETICA>

<FONT SIZE=2><I>We are having</I></FONT>
<BR>

<!--You don't need to type this. Each line below changes the font properties for each letter in the word F - U - N. Notice the space on each side of the dashes. You can type one line and then copy and paste it 5 more times. Then change the colors & the letter accordingly.-->

<FONT SIZE=7 COLOR="RED">F</FONT>
<FONT SIZE=7 COLOR="ORANGE"> - </FONT>
<FONT SIZE=7 COLOR="YELLOW">U</FONT>
<FONT SIZE=7 COLOR="GREEN"> - </FONT>
<FONT SIZE=7 COLOR="BLUE">N</FONT>
<FONT SIZE=7 COLOR="VIOLET">Page</FONT>

</FONT>
</B>

</TD>
</TR>

</TABLE>

</CENTER>

<P>

<!--You don't really need to type this. Stop at this point and look at your page. You should have the background and the title.-->

<B>
Hi! Welcome to my fun page. On this page I would like to share some of life's fun experiences. I have a digital camera that is a lot of fun and allows me to share photos easily on the computer.

<P>

We went to LegoLand the other day. We had lots of fun. As you can see, the boys kept us pretty busy. If it wasn't for the wait in the lunch line, we wouldn't have had any rest. There are many fun things for young kids and parents of young kids to do. We especially liked the fun centers where you could design & build Lego race cars and then race them against other people's cars down a ramp. Older kids might not have as much fun, but then, who knows? I did.

<P>

Enjoy the pictures.
</B>

<P>

<CENTER>

<TABLE BORDER=5 BGCOLOR="#33ffcc" CELLPADDING=10>

<TR ALIGN=MIDDLE>
<TD><IMG SRC="funpage/funpage_01.jpg"></TD>
<TD><IMG SRC="funpage/funpage_02.jpg"></TD>
</TR>

<!--You don't need to type this. Notice the pattern for the next two table rows? Copy the first row, the four rows above with the TR and TD tags, and paste it twice below this point. Then just change the last digit on the image, 1, 2, 3, etc. That's code cloning. It's a life saver.-->

<TR ALIGN=MIDDLE>
<TD><IMG SRC="funpage/funpage_03.jpg"></TD>
<TD><IMG SRC="funpage/funpage_04.jpg"></TD>
</TR>

<TR ALIGN=MIDDLE>
<TD><IMG SRC="funpage/funpage_05.jpg"></TD>
<TD><IMG SRC="funpage/funpage_06.jpg"></TD>
</TR>

<TR ALIGN=MIDDLE>
<TD COLSPAN=2><B>Well what did you think of that? Please come back again. I will update this page with something different, as long as we are having

<!--You don't need to type this. You have already typed the F - U - N code below. Copy it from the title and paste it below this point. Then change the SIZE number from 7 to 4 for each letter. More code cloning.-->

<FONT SIZE=4 COLOR="RED"> F</FONT>
<FONT SIZE=4 COLOR="ORANGE"> - </FONT>
<FONT SIZE=4 COLOR="YELLOW">U</FONT>
<FONT SIZE=4 COLOR="GREEN"> - </FONT>
<FONT SIZE=4 COLOR="BLUE">N</FONT>.
<BR>
<A HREF="mailto:cwalker1@home.com">Email Me</A></B></TD>

</TR>
</TABLE>

</CENTER>

<P>
<HR>
<P>

Please go to my <A HREF="favlinks.htm"><I><B>Favorite Things</B></I></A> page. (click the link)

<P>

Email: <A HREF="mailto:cwalker1@home.com"><B>Craig Walker</B></A>

</BODY>
</HTML>

With this much code it is easy to make a little mistake. Attention to detail is imperative. While putting this page together, I put a couple tag brackets backwards, which nulified all tags after it. I forgot a closing bold tag and all was bold. Of course if it isn't right, your page is the clue. Look where it starts to go sour. It's right there somewhere.

Did you get this far? Email Me

Aren't tables cool? Tables are a fun way to separate objects on the screen. They help you to retain your hard fought page structure. You can use the tables with or without the borders option. See the Fun Page without borders or the green background color on the pictures table.

We used two tables on the Fun Page. They are both created the same way. Start a table, establish rows, add data cells, end the row, repeat row and data process until done, then end the table.

Notice how I separated the table rows as logical groups on the code page. That makes it easier to review and edit your code. I even typically put the individual data cells on separate lines too. Just as you see it on this page.

By the way, the code section on this page is a table with one big data cell that contains all the code for the Fun Page.

Data cells can contain text, graphics, multimedia events, anything you can put on a web page, you can put in a table. You treat each data cell like it's own little mini page as far as formatting goes.

Here are the new Tags as used:

<BODY BACKGROUND="funpage/funpage_07.jpg" TEXT=000066>

Replacing the BGCOLOR option with BACKGROUND="funpage/funpage_07.jpg" tiles the whole background with the funpage_07.jpg image. You need to be careful with this option though. You can put full color or full page size images in the background if you want to. You need to be careful that a full color image wouldn't make the content on the page hard to see. You don't want to distract from the content. A full size image would take too long to load. A full page image could take several minutes just to load the background. This particular image is only about 4KB (4 kilo bytes). The physical size, in inches, is not as big a factor as the file size, bytes, in this respect.

Find out more about graphics in the Graphics Guide.

<TABLE> </TABLE> See the Tables Guide for more about tables.

You begin and end a table with these tags. We also added a few options within the opening tag of the title table, BGCOLOR=33ffcc WIDTH=75%. We added the CELLPADDING option to the pictures table opening tag.

BORDER=# The BORDER option places a grid throughout your table. The # option, i.e. BORDER=5 sets an outside border width of that many pixels. The default, without a # designation is 2 pixels, I think.

There are some differences you should be aware of between the way MS Internet Explorer and Netscape Communicator interpret BORDER colors. Netscape seems to take on the color of the page background where MS IE takes on the color of the table background. In this example the border color drabs out the table in MS IE. In netscape it is a little bit cheerier because of the brighter border color. That of course is a personal opinion. I believe there is a BORDERCOLOR option. When I find out I will let you know.

BGCOLOR sets the background color for the table. It can also be used at the row or cell level by adding it to the TR or TD tags. The more local the tag the more priority it has. In other words, if you set the BGCOLOR in the TABLE tag to green, the whole table will have a green background, but if you designate a row or cell to be blue instead, then the whole table would be green except that row or cell which would be blue. Wow, was that all one sentence. This aint no grammar lesson.

Something that came up when the background color was changed in MS IE. The background color extended up into the caption area. That looked real sloppy with the border around the table, but not the caption, and the background color extending past the border and into the caption region. This happened on MS IE at work but not on MS IE at home.

If the BGCOLOR creeps up into your caption region, you might be happier formatting the BGCOLOR in each row, TR, tag instead of in the TABLE tag.

I recommend cross checking your pages on both browsers if you are serious about publishing them on the Internet.

WIDTH can be specified as WIDTH=# (pixels) or WIDTH=#% (percent of available space). In our case we made the title table WIDTH=75%. That means that no matter how wide the screen is, your title will always be 75% of the available space wide. There is one limit to that though. The table can not get smaller than the data in the table. HEIGHT is also variable just like the WIDTH.

CELLPADDING is used to put a buffer around the data in your cells. In this case, I don't like my pictures butting up against each other. I like space between them because it makes each one easier to see. That is another way of controling our width too. The images are all sized to a specific size and the CELLPADDING buffer will make the table a set width and height.

<TR> </TR>

Start a new Table Row with the TR tag. Stop a table row with the /TR tag. There are several formatting options you can apply to a whole row. ALIGN=MIDDLE places the table data, in this case the images, in the middle of the data cell. When framing your pictures in a bordered table, it looks nice to have an even border around the image.

Data can also be aligned RIGHT, LEFT, or CENTER. The BGCOLOR and BACKGROUND options can also be applied at the row or cell level. For more about table options see the Tables Guide.

<TD> </TD>

Each Table Data cell is enclosed in the TD tags. Each data cell in a row, represents a different table column. Data cells can also be formatted in many ways, separate from the rest of the table, like BGCOLOR, BACKGROUND, ALIGN RIGHT, LEFT, MIDDLE, & CENTER, and more. See the Tables Guide.

COLSPAN=2 tells your browser to let the data in the cell span 2 columns, like the last row in our pictures table. You can specify any or all columns. You can also set the ROWSPAN option for data that might need to span multiple rows. You might want to use these options when combining pictures with text in the same table, like our table. Or when you have landscape and portrait style pictures in the same table.

<FONT SIZE=4 COLOR="RED">

You can specify colors in two ways. You can use the six digit codes we have been using, or you can use the short list of general color names. There is one problem with this though, not all browsers will interpret these codes correctly. If you see the different colors, as written below, then your browser is cool, but what about everyone else's. The Colors are:

  • RED
  • ORANGE
  • YELLOW
  • GREEN
  • BLUE
  • INDIGO
  • VIOLET

I prefer to use the six digit codes because of the more precise selection of the color you want to use. The text color, dark dark blue, on this page would not be possible with the word codes.

<!--Comments here will not show on your page.-->

These are comment tags. They allow you to put comments in your code page for yourself or others to reference. The neat thing is they will not show up in your web page. That's why I said, "You do not need to type this." in each comment. But if you did, it wouldn't show on your page any way.

Graphics

Graphics and pictures can be a lot of fun, but they can also wreck a nice page if not approached correctly. Web pages are all about viewing, reading, and sharing. It's no fun to wait for a page. A large screen size image could be anywhere from 300KB to 1.5MB file size. At approximately 10 minutes per MB, the large image would take almost 15 minutes to load on your page. I'm not waiting that long.

All the pictures on the Fun Page have been specially sized for the page. Each one was reduced to the exact size I wanted you to see and then compressed to about 50% in the jpeg (jpg) format. The six Legoland pictures, in their original state, were about 5.5MB total size. Now they are only 152KB, about 1/36th of the original size. Should take maybe 60 seconds or so on a regular modem service. Now it's worth the wait.

Don't confuse file size with viewing size. File size takes up time. Viewing size is just visual. I can reduce the viewing size of the images, like I did at the top of this page, without changing the file size. At the top of this page I just wanted to conserve space on the page. By reducing the viewable size, I did not save any file size. In this case I wanted the files to stay the same file size but take up less room so when you downloaded them to your computer, they would still be the right size for placing on your Fun Page.

Please visit the Graphics Guide where I will explain the ins and outs of graphics and pictures.

Now for a lesson in Publish It

by Craig Walker


HTML written in Notepad
Best Viewed @ 800 x 600
WebMaster: Craig Walker
cwalker1@cox.net