TABLES
page tags      head tags      text layout      font tags      lists      non-breaking spaces       text commands       accents      image tags      anchors & links      tables      table tags      table properties       cool tags

 

Tables are the best way to pin down all the various images and blocks of text on your page. Simple tables can be quite easily written in HTML, but to write complex tables your best off using HTML authoring software, such as Dreamweaver, Netscape Composer, or Photoshop Slices.

However even if your using software to write the code it helps if you understand the code as you'll quite likely want to edit it yourself afterwards.

As tables are harder to get to grips with than other aspects of HTML I've divided this page into two, first explaining the tags and then explaining the properties that can be assigned to then. If you've never done tables it's best to do the tutorial first.

Click on this link for the tutorial, but be warned there's a lot of code to write in it (I'll be simplifying it when I get the chance).

 


TABLE TAGS
page tags      head tags      text layout      font tags      lists      non-breaking spaces       text commands       accents      image tags      anchors & links      tables      table tags      table properties       cool tags

 

tag FUNCTION end tag
<table> defines a table. All the tables contents go between the tag and the end tag. </table>
<tr>

A table is divided into rows and columns. <tr> defines a new row. Each row is broken up into cells which are defined by the <td> or table division tag and end tag. All the cells line up with the rows above and below to make columns.

So to make a table of two rows and two columns like the one below right you would use the following tag code:

   
   

<table>

<tr>
<td></td>

<td></td>
</tr>

<tr>
<td></td>

<td></td>
</tr>

</table>

As you can see I've ascribed propertes to this table. I deal with this in th next bit

</tr>
<td> </td>

 


TABLE PROPERTIES
page tags      head tags      text layout      font tags      lists      non-breaking spaces       text commands       accents      image tags      anchors & links      tables      table tags      table properties       cool tags

 

tag FUNCTION end tag
<table>

Properties that can be assigned to <table> are:

align the align command in the table tag positions the table on the page, and it can be set to left, center or right

width can be set in pixels width="200" or percent width="80%"

height can be set in pixels or percent.

border sets a border that goes round all the cells. You set the border width in pixels like so: <table border="2">

bordercolor adds colour to the border

bgcolor give the table a background colour

background gives the table a background background image as in background="pictue.gif"

cellpadding creates a text inset on all cells in the table measured in pixels. cellpadding="5" is the inset I've given this table.

cellspacing creates space between table cells. It's defined in pixels jus like border and cellpadding

</table>
<tr> Most properties are best assigned to the <table> or cell <td> tags, but some work on the <tr> tag. </tr>
<td>

Properties that can be assigned to the <td> tag are:

align the align command in the <td> tag aligns text, and it can be set to left, center, right or justify

valign aligns text and images vertically within a cell. values are top, middle, bottom or baseline

width can be set in pixels width="200" or percent width="80%"

height can be set in pixels or percent.

bgcolor give the cell a background colour

background gives the cell a background background image as in background="pictue.gif"

N.B. A table cell must contain some content if you want all browsers to pick up any background properties.

This can be a line break <br> or a non-breaking space &nbsp;

If you put a non-breaking space in an empty cell the basic code would be <td>&nbsp;</td>

</td>

 


ON LINE JONES

Home         CONTINUE TO COOL TAGS

Hosted by www.Geocities.ws

1