Tables - why
are they important?
Tables are a very useful
way of controlling where text and images are placed on a
page, so knowing how to create them is essential.
Here's a table:
OF THE RINGS
AFRAID OF THE BIG BAD WOLF
THE SORCERER'S STONE
You're probably thinking
it doesn't look anything like a table - just wait and
with a table that looks like a table .....
Let's look at the HTML that made the table:
<TD> Mercury </TD>
<TD> Mars </TD>
<TD> Jupiter </TD>
<TD> Saturn </TD>
It looks worse than it is... there are in fact only
three commands being used over and over again. Lets
look at each of them in turn.
<TABLE> this tells the browser to start the table.
Everything between this tag and the end table tag
</TABLE> is contained within the table.
<TR> short for Table Row - tells the browser to
start a new row. </TR> tells the browser to end
<TD> is short for Table Data - not very helpful -
I find it more useful to think of it as a "Table
Cell" command. <TD> starts the cell and
</TD> ends it.
How it works.
Tables (like spreadsheets) are made up of cells
organised into rows and columns. The browser creates the
table, row by row, starting with the first <TR>
How does the browser know how many cells to create in a
row? Well for every <TD> command the browser
reads, it creates a cell, and it will keep on creating
the cells to the right of each other untill it meets an
end of line command, i.e </TR>.
Try it out yourself in the box below ..........