Making Tables

Tables are useful for aligning pictures and text so that everything looks neat and organised.


Here are two examples of a table, with and without a border:

WITH A BORDER
CELL 1
CELL 2
CELL 3
CELL 4
WITHOUT A BORDER
CELL 1
CELL 2
CELL 3
CELL 4

 
 
 
 

Intro

Almost all good websites use tables. They're the easiet way of organising your page so that everything aligns properly and looks professional. They're also quite simple to make!

Attributes

Everything for a table goes between the <TABLE> </TABLE> tags. Inside these tags, you also use <TR> </TR> to signify a new row, and <TD> </TD> to make a new cell.

In the <TABLE> tag, you need to specify the table height and width using WIDTH=80% etc... Next you state the width of the table border, using BORDER=0 if you don't want a border to appear. You can also state the color of the border by writing BORDERCOLOR= and the colour you want. If you want a coloured background in your table, simply write BGCOLOR= You align the table to the left or right in just the same way as an image, or use <CENTER> to centre it.

Making new rows and cells

Next, for each new row, write the <TR>tag. Everytime you write that, a new row will be started. Then, for a new data cell (see above example) use the <TD> </TD> tags. Between these tags is where you put what'll go inside eg text or pictures. Remember to end each cell with </TD>and each row with </TR>

There are also attributes which you can add in the </TD> tag. These are COLSPAN= and ROWSPAN= These allow you to decide how many cells high or wide that cell will be - for example the title of my example tables are COLSPAN=2 and therefore two cells wide.

Here's what my example looks like written out:

<b><font face="comic sans ms"><font color="#000080"><font size=-1>If you're reading this then sorry, but your browser doesn't support floating frames. Maybe you should try Internet Explorer :)</font></font></font></b>