Tables

You can use the table element to control the layout of a page or part of a page.

The element includes 2 child elements, the table row element and the table data cell element.

Using a Table as Part of a Page

Below is an example of the html for a table.

<table width="80%" border="1" cellspacing="0" cellpadding="5">

<tr>
<td>Content goes here</td>
<td>Content goes here</td>
<td>Content goes here</td>
</tr>

<tr>
<td>Content goes here</td>
<td>Content goes here</td>
<td>Content goes here</td>
</tr>

<tr>
<td>Content goes here</td>
<td>Content goes here</td>
<td>Content goes here</td>
</tr>

</table>

 

The table created by the html above looks like this:

Content goes here Content goes here Content goes here
Content goes here Content goes here Content goes here
Content goes here Content goes here Content goes here

 

Using a Table to Format a Page

You can use the table elements to create the layout for your page by inserting a table at the beginning of your page content. Use a value of "0" for your border attribute and no border lines will show on your page.

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>
<td width="20%">Left menu goes here</td>
<td width="80%">Content goes here</td>

</tr>

</table>

 

You can "nest" tables within your page layout table to further organize the information on your page.

TIP: Keep all your borders showing until you complete your layout so you can see the boundaries of each table. Go back later and change the value of the borders to "0".

 

WS_FTP | Doc Types | Head Element | Charset | Links | Tables | Images | CSS | Javascript | Home | Top