5.1 TABLES

Back To NoFrames Version Next


1. BASIC TABLE ELEMENTS

The basic tags you need in order to set up a table are:

<TABLE> is the opening tag to define a table element in a page.
<TR.....>: means table row 1.
<TD...>: means cell 1, in row 1. You close the cell formatting with </TD>
<TD...>: means cell 2, in row 1. Again you close the cell formatting with </TD>
</TR>: is the end tag indicating the end of row 1.
<TR...>: means the start of row 2.
<TD...>: means cell 1, in row 2. You close the cell formatting with </TD>
<TD...>: means cell 2, in row 2. You close the cell, as above.
</TR>: is the end tag indicating the end of row 2.
However many extra "TR's" and "TD's" you need!
</TABLE>



2. TABLE ATTRIBUTES


The best thing you can do is experiment with all this, perhaps using the table I have set up below in which I have made use of all the things a table can do, and all its attributes, as comprehensively as possible!


3. EXAMPLE TABLE


Example Table
rosemarblethmb skythmb my logo
Didiart thumbnail psychthmb woodthb
Click the above to enlarge this thumbnail Couldn't think what to stuff in here!
argallry
This is getting to be a pretty nifty table!
previous page next page chains


4. HOW THE EXAMPLE TABLE WAS CODED


The code for the first table: the heading: "Example Table" on a red background (which has just one row and just one cell):

<TABLE BGCOLOR="#000000" ALIGN="center" BORDER="1" WIDTH="360" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD ALIGN="center" BGCOLOR="#ff0000"><FONT SIZE="5"><B>Example Table</B></FONT></TD>
</TR>
</TABLE>

The code for the main table:

<TABLE ALIGN="center" BORDER="3" BGCOLOR="#000000" CELLPADDING="4" CELLSPACING="4">

First row: 3 image containing cells:

Second row: 3 image containing cells, but cell 1 is a clickable thumbnail - try it!:

Third row: 2 cells, cell 2 spanning 2 cell widths:

Fourth row: 1 cell spanning 3 cell widths that contains an image and below it some text via use of the <BR> tag:

Fifth row: 3 cells, 1 & 2 coloured and containing internal hot links, 3 contains an image and spans the cell in the row below this one:

Sixth row: 2 cells, both coloured (the third one doesn't exist as it is rowspanned by the cell above it!):


The best thing to do with tables is just to get stuck right in there! If I were you, I would set up a basic HTM page in Notepad (or other text editor) and just have a play around having printed off this page first! Though first, you need to formulate a plan (on paper!) as to how you want your table to look, and what you want in the cells. Then you just code this up as per your plan. It will take you a while to get the hang of it, but once you do, there's no lookin' back, man!

As you learn, an additional thing you will pick up along with knowledge is that you will begin to develop a neat WYSIWYG (What You See Is What You Get) editor in your head! What I mean by this is that you will then be able to "visualise" what the result of your coding will be, without having to keep loading your htm source file into a browser continually, in order to see the effect your coding has had! Not only does this save time, but when you develop that ability, you will know for sure that you have become a "proper" HTML propellerhead! Good luck, and have fun!

NEXT: Are you being framed....?

Back To NoFrames Version Next

eyesborder
COPYRIGHT INFORMATION: All Rights Reserved. No part of this HTML tutorial may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior permission of the copyright owner, Didi Austin, who may be contacted using the link below.
© 1999 Didi Austin
eyesborder