* * * * * * * * * * * * * * * Bookmark This Site * * * * * * * * * * * * * * *
Printer Friendly Page

HTML FOR ABSOLUTE BEGINNERS
created by Janet Barrett

CHAPTER TWO
(Creating Tables)

Introduction
Tables Part 1: Columns
Tables Part 2: Headings/Columns
Tables Part 3: Cellpadding/Cellspacing
Tables Part 4: Images/Links
Tables Part 5: Borders/Lists
INTRODUCTION:

A Reminder from Chapter One...............

You will need to be able to see your work on the net. To do this you must use the codes inside your notepad like this:


When you have completed your work you must file it as an .html file ie my_first_page.html - if you don't do this, the browser will not be able to read your work. If it is to be your homepage on your website then you must file it as index.html with no additions to it.

To be able to see your creation - go to your browser bar at the top of your screen and click on:    File > Open > Browse
(at this point you should see "File name:" which is blank and "Files of type: HTML files") then locate your 'my_first_page' file (it will not show the .html) - Click on it and open. Your browser will open your file and reveal your work.

You now have your page on the Internet for viewing and also your notepad with the coding. From hereon when you make changes in your notepad you must file it every time and then hit 'refresh' on your browser to update your page.

Back to Top


Introduction
Tables Part 1: Columns
Tables Part 2: Headings/Columns
Tables Part 3: Cellpadding/Cellspacing
Tables Part 4: Images/Links
Tables Part 5: Borders/Lists
TABLES: Part 1 - Columns

Tables can help you design your page by putting information just about anywhere you want on a page. All the navigation bars you see are created using tables. In fact what you are reading now is nested in a table. With tables you can split up your information into seperate segments creating a well balanced eye-pleasing appearance to your pages.
If you change the border to zero then you end up with an invisible table.

Tables are so versatile and easy to use once you have mastered the basics. As you can see, tables can be split to create columns if you are editing a piece of news.

OK, let's start building tables.
We'll start off with the first table above.

Are you ready?

I wont go into the technical details of all the attributes and cause you a headache! Just follow my examples and you should be alright.

This is the code for the first table above.



This is the code for the second table above.



And there you have it, the beginnings of a table starting to take shape. You can use the font attributes for color etc inside the table to design your masterpiece.

Back to Top


Introduction
Tables Part 1: Columns
Tables Part 2: Headings/Columns
Tables Part 3: Cellpadding/Cellspacing
Tables Part 4: Images/Links
Tables Part 5: Borders/Lists
TABLES: Part 2 - Headings and Columns

HEADING HERE
And in here we can put lots of info about anything you want.
In this instance I used percentages instead of pixels for the table size.
Again if you mark the border as zero, the table will become invisible.


Let's see what the code looks like for the above table.




Here we have a table with a heading and 2 columns below.

HEADING HERE
Here we can have a heading and two columns below. Looks pretty neat. Again if you mark the border as zero, the table will become invisible.

Let's see what the code looks like for that table.



At this point I will try to explain what all that is about.

TABLE BORDER=1 WIDTH=50%
The start of a table that is 1 pixel thick and 50% of the screen width in size.
(You can also use pixels instead to set the width)
TR /TR
Defines each row in a table.
TD /TD
Signifies the beginning/ending of a cell
(or data as I call it)
TD COLSPAN=2
This means a row that spans across two cells
(or columns as above table image)
TD WIDTH=50%
This means the width of data cells set inside a table
(in this instance the two cells were divided into equal halves)
/TD /TR /TABLE
Denotes the completion of a table.

That looks pretty neat doesn't it? I used a table to set it out using a lot of the tags you see.

Practice changing the border thickness and cell widths to see what results you end up with.

Back to Top


Introduction
Tables Part 1: Columns
Tables Part 2: Headings/Columns
Tables Part 3: Cellpadding/Cellspacing
Tables Part 4: Images/Links
Tables Part 5: Borders/Lists
TABLES: Part 3 - Cellpadding and Cellspacing

Table A
LATIN PHRASES
Ama me fideliter, fidem meam noto: de corde totaliter et ex mente tota sum presentialiter absens in remota, quisquis amat taliter, volvitur in rota. Love me faithfully. See my faithfullness: with all my heart and with all my soul, I am with you even when I am far away. Whosoever loves this much turns on the wheel
cellspacing=5
The cellspacing will contract from the actual table frame
and create a 'boxed' look to each cell.

Table B
LATIN PHRASES
Qui nos rodunt confundantur et cum iustis non scribantur. May those who slander us be cursed and may their names not be written in the book of the righteous.
cellpadding=5
The cellpadding will contract the information, in each cell,
away from the main table frame.

Table C
LATIN PHRASES
In necessariis unitas, in dubilis libertas, in omnibus caritas In necessary things, unity; in dubious things, liberty; in all things, charity
cellspacing=5 cellpadding=5

The cellspacing will create a 'boxed' effect and contract from the main table, while at the same time the cellpadding will contract from the 'boxed' effect making sure the information doesnt touch the sides. This is a nice handy option when you are creating colorful borders and backgrounds to the table format.

This is what the table formats look like for all three tables above.
(This time you will see I am using pixels for sizing)

Table A: cellspacing


Table B: cellpadding


Table C: cellpadding and cellspacing


At this stage I want to point out something very important. Look at all the TD WIDTH=300 and the TABLE BORDER=600. When you split the table into cells, the WIDTH sizes must all total up to the TABLE BORDER width - in this case 600.

Practice changing the width sizes of the cells (make sure they add up to the table size). Try using font attributes inside the cells for varying text styles etc.

Back to Top


Introduction
Tables Part 1: Columns
Tables Part 2: Headings/Columns
Tables Part 3: Cellpadding/Cellspacing
Tables Part 4: Images/Links
Tables Part 5: Borders/Lists
TABLES Part 4: Images and Links

In this table we will look at how to create the illusion of an image and text side by side.
This table shows everything in neat order. Sometimes it is best to reduce images to create a more pleasing effect.


In this table we will look at how to create the illusion of an image and text side by side.
This table shows everything in neat order. Sometimes it is best to reduce images to create a more pleasing effect.

With the TABLE BORDER set at "0" it becomes invisible and you achieve the effects as you see above.

Notice the link I placed in the second table?? I'll show you how to do that.

Make it a habit to put the BORDER setting at "1" so you can see where your work is placed.

When your happy with the results you can go back and change the TABLE BORDER setting to "0".

Now let's look at how to place an image inside a table.
I will use the example with the images link.



Notice how I set the TABLE BORDER at "0" and check the link 'images'. You will also notice a new feature, namely the DIV option. This is a feature to force text or images to be placed either LEFT, RIGHT, CENTER. Make sure you close the DIV function with /DIV otherwise everything you do after that, the browser will think you want everything positioned the same.

For everyone out there on the internet to be able to actually view your images, you will need to upload the image into your folders on your chosen web-host. The image address will then look something like this (replace mydomainname with your own actual website name):
< img src="www.mydomainname.com/images/2unis-opt.jpg" >


Back to Top


Introduction
Tables Part 1: Columns
Tables Part 2: Headings/Columns
Tables Part 3: Cellpadding/Cellspacing
Tables Part 4: Images/Links
Tables Part 5: Borders/Lists
TABLES PART 5: Borders and Lists

Let's create a table of Latin Quotes. You will notice the TABLE BORDER is thicker and has a color this time, namely dark red.

I'll show you how to do that in a moment. But first, take a look at the table below. You will notice the cells are different sizes, but they add up to the TABLE total width size.

LATIN QUOTES
Latin
English Translation
Audaces fortuna juvat Fortune favors the bold
Bis repetita placent The things that please are repeated again and again
Ira furor brevis est Anger is a brief madness
Quot capita, to sensus There are as many opinions as there are heads

And here is what the coding looks like.


Have a playaround with the TABLE BORDER thickness and color. Also try changing the cell sizes, cellpadding/cellspacing and see what effects you come up with.

That's it on tables for now. By this time you should have a pretty good idea how they work. Try creating a table of your own, through trial and error you will learn what is possible and what isn't.

Back to Top



If you think you are ready to start a homepage then take a look at this very simple design I created. You can play around with the background colors, font attributes and headings to suit your project.


Back to Top


Questions?


www.scintilla4u.com